#中立
n=[]
a=['works fine','describe honestly','commonly speed','general speed','general speed']#通过count函数进行统计for i in a:
n.append(chapter.text[0].count(i))
n
[3, 0, 0, 0, 0]
#消极
n=[]
a=['poor quality','unclearly','rough','slow delivery','over time','wrong address','no reply','impatient','ineffective']for i in a:
n.append(chapter.text[1].count(i))
n
[0, 0, 0, 0, 0, 0, 0, 0, 0]
#积极
n=[]
a=['high grade','high quality','easy to use','quick delivery','good packaging','wrong address','intact','return in time','friendly','effective']for i in a:
n.append(chapter.text[2].count(i))
这个单子是主要是进行英文评论积极,消极,中立词的统计,主要是用了一些库,别的没有什么import pandas as pdfrom textblob import TextBlob#进行数据的导入test=pd.read_excel('爬虫结果.xls')#查看数据钱test.head() text ...