When to use negation handling in sentiment analysis? – Analytics India Magazine

The technique of determining views or feelings conveyed in the text regarding a subject is referred to as sentiment analysis, also known as opinion mining. Sentiment analysis may be done at the sentence or document level. In linguistics, negatives are particularly essential because they change the polarity of other words. Negative terms include no, not, shouldnt, and so on. When a negation appears in a sentence, it is critical to determine which words are impacted by this phrase. This article will be focused on understanding the concept of negation and implementing it with NegSpacy. Following are the topics to be covered.

The emotion expressed in a text by a person could be understood by machine learning algorithms. Lets understand the concept of sentiment analysis.

Sentiment analysis combines various research areas such as natural language processing, data mining, and text mining, and is rapidly becoming important to organisations as they strive to integrate computational intelligence methods into their operations and attempt to shed more light on, and improve, their products and services. The purpose of sentiment analysis, also known as opinion mining (SAOM), is to uncover peoples written views or text. Sentiment can be defined as how one feels about something, personal experience, ones feeling, attitude toward something, or an opinion.

Opinions are fundamental to practically all human actions and have a significant impact on our behaviour. Our views and perceptions of reality, as well as the decisions we make, are heavily influenced by how others see and interpret the world. As a result, when we need to make a decision, we frequently seek the advice of others. This is true not only for individuals but also for companies. Closed-form customer satisfaction questionnaires have traditionally been used to assess the key components, or facets, of total customer satisfaction. However, developing and implementing surveys might be costly or unavailable. In certain circumstances, governmental entities are even barred by law from collecting customer satisfaction questionnaires.

The sentiment analysis is applicable at both the sentence and document levels. The sentence level determines whether the opinion expressed in a sentence about a subject is positive or negative. In contrast, the whole document is classified as positive or negative at the document level.

Are you looking for a complete repository of Python libraries used in data science,check out here.

Negative words are those that influence the sentiment orientation of other words in a phrase. Negation terms include not, no, never, cannot, shouldnt, wouldnt, and so on. Negation handling is a method of automatically detecting the extent of negation and inverting the polarity of opinionated words that are impacted by a negation. The area of the phrase that negation impacts are referred to as the vicinity or scope of negation.

A negation may reverse the polarity of all words in a phrase that has only one clause. In a compound sentence, however, there are numerous clauses. A negation inverts the polarity of certain words in a phrase, and the quantity of words reversed varies according to linguistic factors. As a result, dealing with negation in a compound phrase might be difficult. To establish the scope of a negative, we create a list of negations that serve as a signal of the presence of a negation.

All negation words are divided into three categories.

One of the most popular language strategies for changing text polarity is negation. As a result, in sentiment analysis, negation must be considered. The scope size of a negative expression specifies which words in the phrase are impacted by negation words like no, not, and never. Negation keywords influence the contextual polarity of words, but their existence in a phrase does not imply that all words conveying feelings will be inverted. As a result, we must additionally identify the scope of negation in each phrase.

Linguistic negation is a difficult issue with several ways to communicate a negative attitude. Negation can be morphological, with a prefix (dis-, non-) or a suffix (-less) denoting it [11]. It might be implied, as in this act being his first and final film. Although this statement has a negative opinion, no negative words are utilised. Negation might also be explicit, which is undesirable.

As discussed above there are three types of negation words, syntactic, diminisher and morphological negations. Lets deep dive into these three negation types.

The most prevalent sort of negation in user-created text is syntactic negation. The majority of available approaches merely determine the range of syntactic negations. Linguistic factors are taken into account in syntactic negation. Conjunction analysis, punctuation marks, and the POS of negation phrases are among the language aspects.

Syntactic negation has two exceptions: when the negation has no scope at all and when the negation word inverts the polarity of the entire clause/sentence without changing any opinionated word. Some exceptions linked to specific linguistic traits have already been examined in separate sections. In some cases, syntactic negations have no meaning when combined with terms like not just, not just, no surprise, and not to mention.

Diminisher negations vary from syntactic negations in that they frequently lessen the polarities of other words rather than completely reversing the polarities. Furthermore, with syntactic negation, the words that lessen the impact may appear anywhere in the phrase rather than after the negative term. In sentences like this mobile scarcely lags and the application crashes seldom, the diminishers (i.e. hardly and rarely) weaken the negative polarity of the words lags and crashes. The negative affected the word after it in the first sentence, but not the word before it in the second.

In certain circumstances, the negation term and the negated opinionated word are merged into a single word, as in end-less, rude, dishonest, non-cooperative, and so on. This is known as morphological negation, and it may be constructed by combining one of the nine prefixes (de-, dis-, il-, im-, in-,ir-, mis-, non-, un-) or one suffix (-less) with a root word. One approach to dealing with such negations is to first attempt to lexicalise all of these sorts of terms. If such a negation occurs in a phrase, polarity is acquired straight from the lexicon without any scope identification or polarity inversion. However, unusual terms may not be in the lexical dictionary, resulting in incorrect categorization.

The alternative method is to break down morphological negation words to get the base word. The lexicon is used to determine the polarity of the root word, which is then reversed. If the root word is not lexicalized, the synonyms polarity is obtained. The lexicon hits can be enhanced by deconstructing the morphological negation and exploiting the polarity of the synonyms list.

In this article, we will be using the NegSpacy library for handling syntactic negations. NegSpacy uses the NegEX algorithm for handling negation in a sentence. NegEx searches for trigger phrases that indicate a clinical condition is negated or possible and then decides which text comes within the scope of the trigger terms. It returns two types of outputs depending upon the input.

Lets start with the installation of spacy and negspacy libraries and also spacy stanza which will help to load the NLP pipelines.

Import necessary libraries

Load the NLP pipeline using spacy_stanza

For this article, we are using the en_core_web_sm NLP model. It is trained for the English language and has 19 labels. The dataset used for training the model is from blogs, newspapers, and comments.

Add negex to the pipeline and filter some entities for faster processing. The filter is not necessary.

Lets check some sentences.

The true indicates the word has a negative meaning and the false indicates the positive sense.

The inability to properly discern the effect of negation on other words is one of the primary causes of mistakes in sentence-level sentiment analysis. With this article, we have understood the concept of negation and handled it with an implementation using Negspacy.

Go here to see the original:

When to use negation handling in sentiment analysis? - Analytics India Magazine

Related Posts

Comments are closed.