Class DefaultChunkerContextGenerator

Namespace
NOpenNLP.Tools.Chunker
Assembly
NOpenNLP.Tools.dll

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

index int

The index of the sequence.

sequence TokenTag[]

The sequence of items over which the beam search is performed.

priorDecisions string[]

The sequence of decisions made prior to the context for which this decision is being made.

additionalContext object[]

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

i int

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

toks string[]

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

tags string[]

The POS tags for the specified tokens.

preds string[]

The previous decisions made in the taging of this sequence. Only indices less than i will 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

index int
tokens string[]
postags string[]
priorDecisions string[]
additionalContext object[]

Returns

string[]