Class DefaultChunkerContextGenerator
Features based on chunking model described in Fei Sha and Fernando Pereira. Shallow parsing with conditional random fields. In Proceedings of HLT-NAACL 2003. Association for Computational Linguistics, 2003.
public class DefaultChunkerContextGenerator : IChunkerContextGenerator, IBeamSearchContextGenerator<TokenTag>
- Inheritance
-
DefaultChunkerContextGenerator
- Implements
- Inherited Members
Constructors
DefaultChunkerContextGenerator()
Creates the default context generator a chunker.
public DefaultChunkerContextGenerator()
Methods
GetContext(int, TokenTag[], string[], object[])
Returns the context for the specified position in the specified sequence (list).
public virtual string[] GetContext(int index, TokenTag[] sequence, string[] priorDecisions, object[] additionalContext)
Parameters
indexintThe index of the sequence.
sequenceTokenTag[]The sequence of items over which the beam search is performed.
priorDecisionsstring[]The sequence of decisions made prior to the context for which this decision is being made.
additionalContextobject[]Any addition context specific to a class implementing this interface.
Returns
- string[]
the context for the specified position in the specified sequence.
GetContext(int, string[], string[], string[])
Returns the contexts for chunking of the specified index.
public virtual string[] GetContext(int i, string[] toks, string[] tags, string[] preds)
Parameters
iintThe index of the token in the specified toks array for which the context should be constructed.
toksstring[]The tokens of the sentence. The
ToStringmethods of these objects should return the token text.tagsstring[]The POS tags for the specified tokens.
predsstring[]The previous decisions made in the taging of this sequence. Only indices less than
iwill be examined.
Returns
- string[]
An array of predictive contexts on which a model basis its decisions.
GetContext(int, string[], string[], string[], object[])
public virtual string[] GetContext(int index, string[] tokens, string[] postags, string[] priorDecisions, object[] additionalContext)
Parameters
Returns
- string[]