简体   繁体   中英

How to find if there is any emotion attached with a sentence in NLP?

For example, if I have the sentence: "I went there yesterday."- It has no emotion or no emotion word. But this sentence: "I was surprised by that" - It has certain emotion in word surprise.

Can we do this using any NLTK library?

If it is just to check the sentiments, you can use the Textblob library. Check following link: https://textblob.readthedocs.io/en/dev/quickstart.html#sentiment-analysis

If there is specific requirement, elaborate the what do you want to achieve. Like, what is the scenario where you want to implement NLTK (or any other library).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM