嗨,我正在尝试使用情感分类器对某些文本文件进行分类包。那个以下程序适用于单个句子,即:
from senti_classifier import senti_classifier
sentences = ['i love u']
pos_score, neg_score = senti_classifier.polarity_scores(sentences)
print pos_score, neg_score
但是,当使用xls文件对每一条记录进行分类时,正、负分的结果都是0.0。
请帮帮我。在
^{pr2}$
Tags:
^{} function 需要一个字符串列表作为参数,但您传递的是单个字符串。把它放到列表中:
相关问题 更多 >
编程相关推荐