Sentiment Analysis

Knowing the public sentiment on various topics can help us make informed & profitable business decisions. It will help us in knowing the satisfaction/resentment of the consumers towards company policies. Usually, this is done on the entire document. But a document as whole talks about multiple topics or “entities”. It’s these individual entity sentiments that help us in setting up a feedback system, allowing the business entity to work towards improving the user experience.

The primary source of gathering user experience regarding the service is social media. Now, consider a company such as Google or Amazon that has a very large user base. In such a case, collecting user reviews manually, understanding them, and then categorizing them can be a very challenging task. Instead, we have specialized applications that collect entity-related sentiments on social media and feed them to a sentiment language model that outputs the probability of the review being a positive, neutral, or negative sentiment.

Even product-based companies can use sentiment analysis similarly to find out user compatibility with their products or services especially after major policy changes.

Simple sentiment classification of text into different emotional is well solved with recent ML progress. However, the classical sentiment analysis just tells about the average tonality of text instead of a detailed explanation on the entities and words levels. For instance, how would you classify such a sentence as “I hate coffee on this sunny morning”,? Positive because the morning is sunny, or Negative because I hate coffee, or maybe Neutral on average? In fact, the sentiment very much depends on the aspect to which or whom we define a sentiment polarity.

Usage Example

For the given review, a lot of entities are mentioned. For us to do entity sentiment analysis, we need to first identify the entities and then find out the sentiment associated with them.

Our Sentiment Analysis Models

  1. Our model to evaluate sentiments of English language news is based on TF-IDF vectorization of text. To deal with ambitious word combinations like “not terrible”, “not bad” we applied n-grams splitting of the text. C-Support Vector Classifier was used at the top of it. To train our model we used a human-labeled dataset of news titles sentiment created by Connexun team.
  2. Multilingual sentiment model based on the pre-trained joeddav/xlm-roberta-large-xnli model. This model is a result of fine-tuning of xlm-roberta-large on a combination of Natural Language Inference (NLI) data in many languages. It is widely used for zero-shot text classification. NLI approach defines is two sentences in entailment between each other or in contradiction or neutral with respect to each other.
  3. Sentiment analysis of entities with respect to their context exploits the Aspect Based Sentiment Analysis. On top of this model, we fine-tuned the logistic regression classifier which provides probabilities that a given NER has positive or negative sentiment in a given sentence. The logistic regression was trained on a human-labeled training dataset created in Connexun.

Application in various industries. Recommender systems for e-commerce

Recommender systems predict user preferences by recommending new products based on user history or based on similar users’ interests. Suppose we are working with a retail store site and our user is looking for a new book. Our entity sentiment model assigns a sentiment score to each of the entities in the given review. Our recommender system will recommend this book to the user if the entities have a good sentiment score and they match with our user’s preferences based on his/her search history and previously purchased products.

Bank Performance and News Sentiment

In the below example, we have plotted the change in daily closing index prices for UNICREDIT bank against the average daily sentiment. The average daily sentiment, which is calculated based on news reports mentioning the bank, is a value that lies between -1 to +1 where -1 is the maximum negative sentiment and +1 is the maximum positive sentiment. The Pearson correlation coefficient, which tells us the relation between two different variables, is 0.575 in this case suggesting a strong positive relation between index price changes and firm-news sentiment.

Our Services

The API assigns a negative label to the paragraph with a sentiment score of -0.43125 which tells us that it conveys a moderately negative emotion.

Shown below is the working of the Short Text Geoparser API. The API takes as input a short sentence and returns a list of countries ranked according to their proximity within the semantic space constructed with the help of millions of world news articles present in our archive.

The API returns a list of countries with Italy having the highest score because the ‘Leaning tower of Pisa’ is a monument in Italy. This can be of particular use when selecting potential markets pertaining to the expansion of a new product.

Check out our NEWS APIs that not only give you the top news from all over the world but also local news, inter-country news, and country-specific news. Shown below is the working of the Topic Research API. Given a keyword or a set of keywords, this API will return all articles on the internet related to the keyword. This will be helpful for not only school and college students but also for research practitioners.

The InterCountry API allows for getting new in relation with countries along with the overall sentiment pertaining to that particular piece of news. Key entities in each piece of news are also mentioned for your reference. It also clubs articles pertaining to the same piece of news together.

Conclusion

About Connexun

Connexun crawls news content from tens of thousands of open web sources worldwide; turning unstructured web content into machine-readable news data APIs. Its AI powered news engine B.I.R.B.AL. empowers organizations to transform the world’s news into real-time business insight.

To learn more about Connexun, subscribe to our medium blog, follow us on Linkedin, Twitter, Facebook, and visit our demos.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Connexun | news api

Connexun is the ultimate AI news engine — turning unstructured news content into multi-purpose actionable data.