How do sentiment models work?

There are two main things needed to carry out a good sentiment analysis: the knowledge of the sentiment information words have, and an in depth morphosyntactical analysis of the text. With just a list of which words are positive and which ones are negative, common structures such as negation or coordinated sentences expressing opposing ideas are not correctly evaluated. On the other hand, if you have only a morphosyntactic analysis, you don't have information about what has a positive or negative meaning.

MeaningCloud provides both with Sentiment Analysis.

Sentiment models are a way of customizing the sentiment analysis you carry out of your texts. There are scenarios where, because of the specific language used or because of the analysis you are trying to achieve, you may want to take into account a different sentiment analysis that the one provided by a general model.

Take for instance the word "beaten". In general it has a negative connotation: "They were beaten badly by the other team", "He declared he was beaten with a bat", but if you were analyzing recipes, you could easily find the expression "Once the eggs are beaten...", which is not negative at all.

Another good example of the need of customized sentiment models is the variants you can find in the same language depending on the region of origin of the speaker. For instance, while "dill" is in general used as the name of an aromatic herb, in Australia and New Zeland, it's also used as an insult.

This is the gist of what we are going to talk about in detail in this documentation. The terms we are going to use repeteadly are in bold:

A sentiment model is composed by a collection of entries; entries are defined by a word or multiwords (group of words that appear together in the text). In some cases, we will want to define more complex scenarios, not just a word or multiword, so for that we will use subentries (which are always related to an entry). Both entries and subentries consist on their definition and the sentiment behavior associated to them.

The following examples are extracted from the Restaurants example model we provide, and they show some of the things you will be able to do:

  • Assign a polarity to a word, for instance, accommodating as positive: "the staff were very accommodating".
  • Assign a polarity to a collection of words through the use of lemmas, for instance, pack with negative polarity will affect to all the tense forms of the verb pack: "The place was packed when we arrived".
  • Remove the polarity from a word when it behaves as a specific part of speech in the text, for instance, relish is positive as a verb, but we don't want that when it behaves as a noun: "The avocado relish was delicious".
  • Assign a polarity to a specific combination of words, for instance, home delivery as something positive: "The restaurant did home deliveries."
  • Assign polarity to a word or group of words depending on the context they appear in, for instance, service will be negative when it appears with slow: "The service was very slow".

Keep reading to learn how to configure all of these scenarios!