Method GetSentimentCategory
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
GetSentimentCategory(string, CancellationToken)
Analyzes the sentiment of a specified text and classifies it into a category defined in the SentimentAnalysis.SentimentCategory enumeration.
public SentimentAnalysis.SentimentCategory GetSentimentCategory(string text, CancellationToken cancellationToken = default)
Parameters
text
stringThe text to be analyzed and classified. This should be a plain text string without any markup or special formatting.
cancellationToken
CancellationTokenOptional. A CancellationToken for handling cancellation requests.
Returns
- SentimentAnalysis.SentimentCategory
A member of the SentimentAnalysis.SentimentCategory enumeration that matches the category associated with the plain text.
Exceptions
- OperationCanceledException
Thrown when the operation is cancelled based on the CancellationToken.