Table of Contents

Method ExtractKeywords

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

ExtractKeywords(string, CancellationToken)

Extracts a set of keywords synchronously from the given content. If unsuccessful, throws an exception indicating the cause of the failure.

public List<KeywordExtraction.KeywordItem> ExtractKeywords(string content, CancellationToken cancellationToken = default)

Parameters

content string

The text content from which to extract keywords.

cancellationToken CancellationToken

A token to cancel the operation if needed.

Returns

List<KeywordExtraction.KeywordItem>

A list of extracted KeywordExtraction.KeywordItem instances.

Examples

var extractedKeywords = extractor.ExtractKeywords("This is some example content about cars and trucks.");
foreach (var keyword in extractedKeywords)
{
    Console.WriteLine(keyword.Value);
}

Exceptions

ArgumentNullException

Thrown when the content is null or empty.