Sentiment Analysis Levels
Vertica Pulse is capable of determining sentiment at the following levels:
- Attribute
- Sentence
- Document
You can specify an analysis level using the granularity parameter of the SentimentAnalysis function. You can perform multiple levels of analysis simultaneously within the same query.
Attribute-Level Analysis
Attribute level analysis provides a sentiment for each object in a sentence. This behavior is the default level of analysis for Pulse. Attribute analysis identifies the objects of a sentence and any sentiment expressed regarding those objects.
The following example shows the sentiment expressed with regard to "camera" and "quality pictures."
Select SentimentAnalysis ('The camera takes great quality pictures but is expensive. It feels like a professional one' USING PARAMETERS granularity='A') over();
sentence | attribute | sentiment_score ---------+------------------+----------------- 1 | camera | 1 1 | quality pictures | 1
Sentence-Level Analysis
A sentence level analysis provides the overall sentiment of each sentence in a document. If a sentence is contains both positive and negative sentiments, it appears as mixed.
The following example shows two sentences, the first of which is mixed. As a mixed sentiment, the sentiment score is 0, or neutral, and the mixed value is true. The second sentence is entirely positive. Its sentiment is 1, or positive, and the mixed value is false.
Select SentimentAnalysis ('The camera takes great quality pictures but is expensive. It feels like a professional one' USING PARAMETERS granularity='S') over();
sentence | sentiment_score | mixed ----------+-----------------+------- 1 | 0 | true 2 | 1 | false
Document-Level Analysis
Document level analysis provides the overall sentiment of an entire document. If you wanted to know if a movie review was positive, negative, or mixed, a document level analysis could provide that information. Document level analysis gives both the overall sentiment score and a mixed rating if the sentiment is not exclusively positive or negative.
The following example shows that overall, the writer is positive but does express some negative sentiments.
Select SentimentAnalysis ('The camera takes great quality pictures but is expensive. It feels like a professional one' USING PARAMETERS granularity='D') over();
sentiment_score | mixed -----------------+------- 1 | true