Table of Contents

Class TextTranslation

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

A class designed to handle the translation of plain text and language detection.
This class provides an efficient and streamlined approach to manage multilingual content conversion and linguistic analysis.

public sealed class TextTranslation
Inheritance
TextTranslation
Inherited Members

Constructors

TextTranslation(LLM)

Initializes a new instance of the TextTranslation class.

Properties

Confidence

Confidence of the last language detection process, expressed as a floating-point value ranging from 0 to 1.
A score closer to 1 indicates a higher confidence level in the categorization accuracy, while a score closer to 0 suggests lower confidence.
This metric can be used to evaluate and filter predictions based on their reliability.

Model

Gets the Model instance associated with this object.

Methods

DetectLanguage(string, IEnumerable<Language>, CancellationToken)

Detects the language of a specified plain text.

DetectLanguageAsync(string, IEnumerable<Language>, CancellationToken)

Detects the language of a specified plain text.

Translate(string, Language, CancellationToken)

Converts plain text into a specified target language while maintaining the original layout.

TranslateAsync(string, Language, CancellationToken)

Converts plain text into a specified target language while maintaining the original layout.

Events

AfterTextCompletion

This event is triggered following the execution of a text completion.