Class DefaultNameContextGenerator

Namespace
NOpenNLP.Tools.Namefind
Assembly
NOpenNLP.Tools.dll

Class for determining contextual features for a tag/chunk style named-entity recognizer.

public class DefaultNameContextGenerator : INameContextGenerator, IBeamSearchContextGenerator<string>
Inheritance
DefaultNameContextGenerator
Implements
Inherited Members

Constructors

DefaultNameContextGenerator(params IAdaptiveFeatureGenerator[]?)

Creates a name context generator with the specified cache size.

public DefaultNameContextGenerator(params IAdaptiveFeatureGenerator[]? featureGenerators)

Parameters

featureGenerators IAdaptiveFeatureGenerator[]

Fields

featureGenerators

protected IAdaptiveFeatureGenerator[] featureGenerators

Field Value

IAdaptiveFeatureGenerator[]

Methods

AddFeatureGenerator(IAdaptiveFeatureGenerator)

Adds a feature generator to this set of feature generators.

public virtual void AddFeatureGenerator(IAdaptiveFeatureGenerator generator)

Parameters

generator IAdaptiveFeatureGenerator

The feature generator to add.

ClearAdaptiveData()

Informs all the feature generators for a name finder that the context of the adaptive data (typically a document) is no longer valid.

public virtual void ClearAdaptiveData()

GetContext(int, string[], string[]?, object[])

Return the context for finding names at the specified index.

public virtual string[] GetContext(int index, string[] tokens, string[]? preds, object[] additionalContext)

Parameters

index int

The index of the token in the specified toks array for which the context should be constructed.

tokens string[]

The tokens of the sentence. The ToString() methods of these objects should return the token text.

preds string[]

The previous decisions made in the tagging of this sequence. Only indices less than index will be examined.

additionalContext object[]

Addition features which may be based on a context outside of the sentence.

Returns

string[]

the context for finding names at the specified index.

UpdateAdaptiveData(string[], string[])

Informs all the feature generators for a name finder that the specified tokens have been classified with the coorisponds set of specified outcomes.

public virtual void UpdateAdaptiveData(string[] tokens, string[] outcomes)

Parameters

tokens string[]

The tokens of the sentence or other text unit which has been processed.

outcomes string[]

The outcomes associated with the specified tokens.