Python Forum
How to recognize negative in a text? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to recognize negative in a text? (/thread-35169.html)



How to recognize negative in a text? - AlekseyPython - Oct-06-2021

With word2vec I can vectorize both individual words and whole texts (as the arithmetic mean of all words included in the text). But at the same time, positive and negative text receive one vector representation, although they talk about mutually opposite things. Searching for the particles "no" or "not" in the text to reveal negation is not always effective, because many words have antonyms and such pairs are not recognized as opposites.

How to recognize negation in a text?


RE: How to recognize negative in a text? - Larz60+ - Oct-06-2021

There appears to be an interface available for word2vec that allows interface with NLTK
it's located here: https://streamhacker.com/2014/12/29/word2vec-nltk/

then with NLTK, you have the sentiment package that will find all of the negation for you
see: https://www.nltk.org/api/nltk.sentiment.html

I don't know enough about your project, or about word2vec to know if this will be of use or not, but looks like a possibility at any rate.

There's also this article about doing it all, including thesentiment analysis with NLTK, perhaps of vaue to you: https://towardsdatascience.com/a-game-of-words-vectorization-tagging-and-sentiment-analysis-c78ff9a07e42