TargetSentiment Class
- java.
lang. Object - com.
azure. ai. textanalytics. models. TargetSentiment
- com.
public final class TargetSentiment
The TargetSentiment model.
Constructor Summary
| Constructor | Description |
|---|---|
| TargetSentiment() |
Constructs a |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Sentiment |
getConfidenceScores()
Gets the confidence score of the sentiment label. |
| int |
getLength()
Gets the length of target text. |
| int |
getOffset()
Gets the target text offset from the start of document. |
|
Text |
getSentiment()
Gets the target text sentiment label: POSITIVE, NEGATIVE, MIXED. |
| String |
getText()
Gets the target text property. |
Methods inherited from java.lang.Object
Constructor Details
TargetSentiment
public TargetSentiment()
Constructs a TargetSentiment model.
Method Details
getConfidenceScores
public SentimentConfidenceScores getConfidenceScores()
Gets the confidence score of the sentiment label. All score values sum up to 1, the higher the score, the higher the confidence in the sentiment. AspectSentiment only has positive or negative confidence score value because there is no neutral sentiment label in the AspectSentiment.
Returns:
getLength
public int getLength()
Gets the length of target text.
Returns:
getOffset
public int getOffset()
Gets the target text offset from the start of document.
Returns:
getSentiment
public TextSentiment getSentiment()
Gets the target text sentiment label: POSITIVE, NEGATIVE, MIXED. TextSentiment has NEUTRAL sentiment type additionally, but target sentiment can only be POSITIVE, NEGATIVE, or MIXED.
Returns:
getText
public String getText()
Gets the target text property.
Returns: