E - Type of tokens in the tagging.public abstract class ChainCrfFeatures<E> extends Object
ChainCrfFeatures interface specifies methods for
extracting node and edge features for a conditional random field.
Typically, these features will be created by an implementation
of ChainCrfFeatureExtractor in the context of CRF training
or tagging. In this case, the previous tag is guaranteed to fall
in the set of tags provided at construction time.
During construction, the features implementation may cache values, such as part-of-speech tags for CRF chunker features.
| Constructor and Description |
|---|
ChainCrfFeatures(List<E> tokens,
List<String> tags)
Construct a chain CRF feature set for the specified lists of
input tokens and possible output tags.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Map<String,? extends Number> |
edgeFeatures(int n,
int previousTagIndex)
Return the edge features for the specified input position
and index of the previous tag.
|
abstract Map<String,? extends Number> |
nodeFeatures(int n)
Return the node features for the specified input position.
|
int |
numTags()
Returns the number of possible output tags for this feature
set.
|
int |
numTokens()
Returns the number of tokens for this feature set.
|
String |
tag(int k)
Return the output tag with the specified index.
|
E |
token(int n)
Return the token at the specified input position.
|
public int numTokens()
public E token(int n)
n - Input position.IndexOutOfBoundsException - If the specified input
position is less than 0 or greater than or equal to the number
of tokens.public int numTags()
public String tag(int k)
IndexOutOfBoundsException - If the specified index is less than 0
or greater than or equal to the number of tokens.public abstract Map<String,? extends Number> nodeFeatures(int n)
n - Position in input token sequence.IndexOutOfBoundsException - If the specifieid token position
is out of bounds.public abstract Map<String,? extends Number> edgeFeatures(int n, int previousTagIndex)
n - Position in input token sequence.previousTagIndex - Index of previous tag in list of tags.IndexOutOfBoundsException - If the specifieid token position or
tag index are out of bounds.Copyright © 2016 Alias-i, Inc.. All rights reserved.