#中立
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))