Can I use NLTK to determine if a comment is a positive one or a negative one?

后端 未结 4 828
广开言路
广开言路 2021-02-09 02:30

Can you show me a simple example using http://www.nltk.org/code to determine if a string about a happy or upset mood?

4条回答
  •  你的背包
    2021-02-09 02:44

    NLTK cannot out of the box, but if you are looking for some related research on that area, take a look at this paper on Offensive Language Detection. The same methods could be adapted to detect comments which are not offensive/unoffensive, but instead happy/unhappy. The primary software package being used in this project for text classification is called WEKA and uses multiple classifiers, trained on previous examples, to determine whether language is offensive or not (and in this method uses a tunable threshold).

提交回复
热议问题