|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.crf.ChainCrfFeatures<E>
E - Type of tokens in the tagging.public abstract class ChainCrfFeatures<E>
The 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 Summary | |
|---|---|
ChainCrfFeatures(List<E> tokens,
List<String> tags)
Construct a chain CRF feature set for the specified lists of input tokens and possible output tags. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChainCrfFeatures(List<E> tokens,
List<String> tags)
tokens - Input tokens.tags - Possible output tags.| Method Detail |
|---|
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||