Table of Contents

Class NamedEntityRecognition

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

A class for performing Named Entity Recognition (NER) on input text using a Language Model (LM). This class identifies and extracts all occurrences of specified entity types (built‐in or custom) from the provided text, returning each entity verbatim along with its type and optional positional information.

public class NamedEntityRecognition
Inheritance
NamedEntityRecognition
Inherited Members

Remarks

Use this class to extract entities such as persons, organizations, locations, dates, etc., by leveraging an underlying LMKit LM model. You can customize which entity types to extract by setting the EntityDefinitions property.

Constructors

NamedEntityRecognition(LM)

Initializes a new instance of NamedEntityRecognition with default entity definitions (all built‐in NamedEntityRecognition.NamedEntityType values except Custom).

NamedEntityRecognition(LM, List<EntityDefinition>)

Initializes a new instance of NamedEntityRecognition with a custom list of entity definitions.

Properties

Confidence

Gets the confidence score of the last recognition operation.

EntityDefinitions

Gets or sets the list of entity types (built‐in and/or custom) that this recognizer will extract. Must contain at least one NamedEntityRecognition.EntityDefinition; otherwise, an ArgumentNullException is thrown.

Model

The underlying LM instance used for performing extraction.

Methods

Recognize(string, CancellationToken)

Synchronously recognizes named entities in the given content.

RecognizeAsync(string, CancellationToken)

Asynchronously recognizes named entities in the given content.