Method RecognizeAsync
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
RecognizeAsync(Attachment, CancellationToken)
Asynchronously recognizes named entities in the given image attachment.
public Task<List<NamedEntityRecognition.ExtractedEntity>> RecognizeAsync(Attachment content, CancellationToken cancellationToken = default)
Parameters
contentAttachmentThe attachment representing the image to analyze.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<List<NamedEntityRecognition.ExtractedEntity>>
A task that resolves to a list of detected NamedEntityRecognition.ExtractedEntity instances.
Exceptions
- ArgumentNullException
Thrown when the attachment is null.
- InvalidModelException
Thrown when the underlying language model does not support vision input, which is required to analyze images for entity recognition.
RecognizeAsync(string, CancellationToken)
Asynchronously recognizes named entities in the given content.
public Task<List<NamedEntityRecognition.ExtractedEntity>> RecognizeAsync(string content, CancellationToken cancellationToken = default)
Parameters
contentstringThe non-null, non-empty input text to analyze.
cancellationTokenCancellationToken
Returns
- Task<List<NamedEntityRecognition.ExtractedEntity>>
A task that resolves to a list of NamedEntityRecognition.ExtractedEntity objects representing each detected entity.
Exceptions
- ArgumentException
Thrown if
contentis null or whitespace.