Class DefaultNameContextGenerator
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
featureGeneratorsIAdaptiveFeatureGenerator[]
Fields
featureGenerators
protected IAdaptiveFeatureGenerator[] featureGenerators
Field Value
Methods
AddFeatureGenerator(IAdaptiveFeatureGenerator)
Adds a feature generator to this set of feature generators.
public virtual void AddFeatureGenerator(IAdaptiveFeatureGenerator generator)
Parameters
generatorIAdaptiveFeatureGeneratorThe 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
indexintThe index of the token in the specified toks array for which the context should be constructed.
tokensstring[]The tokens of the sentence. The ToString() methods of these objects should return the token text.
predsstring[]The previous decisions made in the tagging of this sequence. Only indices less than
indexwill be examined.additionalContextobject[]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)