You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ♪ "Until the Day" by JJ Lintest_text="""In the middle of the night. Lonely souls travel in time.Familiar hearts start to entwine.We imagine what we'll find, in another life. """.lower()
ht_eng=HarvestText(language="en")
sentences=ht_eng.cut_sentences(test_text) # 分句# 情感分析sent_dict=ht_eng.build_sent_dict(sentences, pos_seeds=["familiar"], neg_seeds=["lonely"],
min_times=1, stopwords={'in', 'to'})
print("sentiment analysis")
forsent0insentences:
print(sent0, "%.3f"%ht_eng.analyse_sent(sent0))
# 情感分析也提供了一个内置英文词典资源# from harvesttext.resources import get_english_senti_lexicon# sent_lexicon = get_english_senti_lexicon()# sent_dict = ht_eng.build_sent_dict(sentences, pos_seeds=sent_lexicon["pos"], neg_seeds=sent_lexicon["neg"])# 然后仿照上面操作
sentiment analysis
in the middle of the night. 0.000
lonely souls travel in time. -1.600
familiar hearts start to entwine. 1.600
we imagine what we'll find, in another life. 0.000
a nlp beginner, 最近在看无(弱)监督的情感分析,想知道这个项目对英文文本效果如何?
The text was updated successfully, but these errors were encountered: