SentimentAnalysisServiceAnalyzeText Method |
Analyzes the sentiment of given text.
Namespace: CMS.TextAnalytics.AzureAssembly: CMS.TextAnalytics.Azure (in CMS.TextAnalytics.Azure.dll) Version: 13.0.131
Syntax public DocumentSentiment AnalyzeText(
string text,
string cultureCode,
string siteName
)
Parameters
- text
- Type: SystemString
Text to analyze. - cultureCode
- Type: SystemString
Culture of the provided text.
If unspecified, this value will be set to the default language ('en') in the request sent to the service.
If set to an empty string, the service will apply a model where the language is explicitly set to "None". - siteName
- Type: SystemString
Site whose Sentiment Analysis API configuration to use.
Return Value
Type:
DocumentSentimentReturns the sentiment analysis result.
Implements
ISentimentAnalysisServiceAnalyzeText(String, String, String)Exceptions Exception | Condition |
---|
ArgumentNullException | Thrown when text is null. |
ArgumentException | Thrown when cultureCode is not supported by Azure Sentiment Analysis service. |
InvalidOperationException | Thrown when the API endpoint or key are not configured for the siteName. |
RequestFailedException | Thrown when Azure service returned a non-success status code. |
See Also