Recipe 6-3. Next Word Prediction

in this section, we will build an LSTM model to learn sequences of words
from email data. We will use this model to predict the next word.

file_content = pd.read_csv(‘spam.csv’, encoding = “ISO-8859-1”)
#Just selecting emails and connverting it into list
Email_Data = file_content[[ ‘v2’]]
list_data = Email_Data.values.tolist()
list_data
#output
[[ ‘Go until jurong point, crazy… Available only in bugis n
great world la e buffet… Cine there got amore wat…’],
[‘Ok lar… Joking wif u oni…’],
[ “Free entry in 2 a wkly comp to win FA Cup final tkts 21st
May 2005. Text FA to 87121 to receive entry question(std txt
rate)T&C’s apply 08452810075over18’s”],
[‘U dun say so early hor… U c already then say…’],
[“Nah I don’t think he goes to usf, he lives around here though”],
[" FreeMsg Hey there darling it’s been 3 week’s now and no word
back! I’d like some fun you up for it still? Tb ok! XxX std
chgs to send, å£1.50 to rcv"],
[’ Even my brother is not like to speak with me. They treat me
like aids patent.’],
[" As per your request ‘Melle Melle (Oru Minnaminunginte
Nurungu Vettam)’ has been set as your callertune for all
Callers. Press *9 to copy your friends Callertune"],
Chapter 6 Deep Learning for nLp
221
[ ‘WINNER!! As a valued network customer you have been selected
to receivea å£900 prize reward! To claim call 09061701461.
Claim code KL341. Valid 12 hours only.’] ,
[ ‘Had your mobile 11 months or more? U R entitled to Update
to the latest colour mobiles with camera

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值