Table of Contents

Method GetSentimentCategoryAsync

Namespace
LMKit.TextAnalysis
Assembly
LM-Kit.NET.dll

GetSentimentCategoryAsync(string, CancellationToken)

Analyzes the sentiment of a specified text and classifies it into a category defined in the SentimentAnalysis.SentimentCategory enumeration.

public Task<SentimentAnalysis.SentimentCategory> GetSentimentCategoryAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string

The text to be analyzed and classified. This should be a plain text string without any markup or special formatting.

cancellationToken CancellationToken

Optional. A CancellationToken for handling cancellation requests.

Returns

Task<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.