Share via


TargetSentiment Class

  • java.lang.Object
    • com.azure.ai.textanalytics.models.TargetSentiment

public final class TargetSentiment

The TargetSentiment model.

Constructor Summary

Constructor Description
TargetSentiment()

Constructs a TargetSentiment model.

Method Summary

Modifier and Type Method and Description
SentimentConfidenceScores 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.

TextSentiment 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:

The length of target text.

getOffset

public int getOffset()

Gets the target text offset from the start of document.

Returns:

The target text offset from the start of document.

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:

The sentiment value.

getText

public String getText()

Gets the target text property.

Returns:

The text value.

Applies to