Table of Contents

Method GetEmotionCategoryAsync

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

GetEmotionCategoryAsync(string, CancellationToken)

Analyzes the emotional tone of a given text and classifies it into a specific category as defined by the EmotionDetection.EmotionCategory enumeration.

public Task<EmotionDetection.EmotionCategory> GetEmotionCategoryAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string

The text to analyze for emotional content. This should be a non-empty string representing the textual content whose emotion is to be classified.

cancellationToken CancellationToken

Optional. A CancellationToken for handling cancellation requests.

Returns

Task<EmotionDetection.EmotionCategory>

A member of the EmotionDetection.EmotionCategory enumeration that matches the category associated with the plain text.

Exceptions

OperationCanceledException

Thrown when the operation is cancelled based on the CancellationToken.