我试着用effect WordNet来表达不同的情绪,比如:愤怒,不喜欢,恐惧,消极恐惧,快乐,悲伤等等
我在库上找到了一个代码示例:https://github.com/clemtoy/WNAffect
from wnaffect import WNAffect
import nltk
nltk.download('dict')
wna = WNAffect('wordnet-1.6/', 'wn-domains-3.2/')
emo = wna.get_emotion('angry', 'JJ')
print(emo)
我测试了一下,得到了一个错误:
Resource dict not found. Please use the NLTK Downloader to obtain the resource:
import nltk nltk.download('dict')
之前有人问过类似的问题:Extract “emotion words” / affect words from english corpus? 但是他们用sentiwordNet检索正负分,解决了这个问题!在
目前没有回答
相关问题 更多 >
编程相关推荐