sentiment

Purpose

Finds documents that contain argument terms with positive or negative sentiments from the parent node Sentiment Analysis.

Syntax

sentiment([sentiment_type] [, term…​])

Arguments

Takes one or several arguments:

  • the first required argument restricts the sentiment type ("Positive", "Negative");

  • the next optional arguments define the sentiment attributes. If the arguments are not specified, the function finds all the positive or negative terms.

  • degree attribute specifies the degree of sentiment.

In order to filter out the results of the sentiment() function, one can use the regex() function. Thus, the query sentiment(Positive, Match:="regex(.*good.*)") will leave in the results the positive sentiments containing the word "good", for example, "The chances are very good", "the asset is good quality".

Returned Value

Documents matching the query.

Examples

sentiment(negative, "object=customer service", "degree=-5") = sentiment(negative, customer service, "degree=-5") returns the feedback on customer service quality with the highest degree of negative evaluation, e.g. "the customer service is very bad", "horrible customer service" or "shame on their customer service".

sentiment(positive, "subject=company", "evaluation=regex(*success.*)") returns the mentions of a company’s success, e.g. "the company successfully increased commercial deliveries" or "the company is successful with recovering raw material price increases".

sentiment(positive, "headobject=bag", "degree>=3") returns the feedback on bags with positive evaluation greater or equal to 3 points. For instance, "the resealable bags are also nice", "I like the individual tea bags" or "the single serve bags are really great".