I\'m currently working on a project, where I want to extract emotion from text. As I\'m using conceptnet5 (a semantic network), I can\'t however simply prefix words in a sentenc
Cases like wasn't
can be simply parsed by tokenization (tokens = nltk.word_tokenize(sentence)
): wasn't
will turn into was
and n't
.
But negative meaning can also be formed by 'Quasi negative words, like hardly, barely, seldom' and 'Implied negatives, such as fail, prevent, reluctant, deny, absent', look into this paper. Even more detailed analysis can be found in Christopher Potts' On the negativity of negation .
Considering your initial problem, sentiment analysis, most modern approaches, as far as I know, don't process negations explicitly; instead, they use supervised approaches with high-order n-grams. Those actually processing negation usually append special prefix NOT_ to all words between negation and punctuation marks.