|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.cogroo.tools.featurizer.FeaturizerME
public class FeaturizerME
The class represents a maximum-entropy-based chunker. Such a chunker can be used to find flat structures based on sequence inputs such as noun phrases or named entities.
| Field Summary | |
|---|---|
static int |
DEFAULT_BEAM_SIZE
|
| Constructor Summary | |
|---|---|
FeaturizerME(FeaturizerModel model)
Initializes the current instance with the specified model. |
|
FeaturizerME(FeaturizerModel model,
int beamSize)
Initializes the current instance with the specified model and the specified beam size. |
|
| Method Summary | |
|---|---|
String[] |
featurize(String[] toks,
String[] tags)
Generates chunk tags for the given sequence returning the result in an array. |
double[] |
probs()
Returns an array with the probabilities of the last decoded sequence. |
void |
probs(double[] probs)
Populates the specified array with the probabilities of the last decoded sequence. |
opennlp.tools.util.Sequence[] |
topKSequences(String[] sentence,
String[] tags)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags |
opennlp.tools.util.Sequence[] |
topKSequences(String[] sentence,
String[] tags,
double minSequenceScore)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags |
static FeaturizerModel |
train(String lang,
opennlp.tools.util.ObjectStream<FeatureSample> in,
opennlp.tools.util.TrainingParameters mlParams,
FeaturizerFactory factory)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BEAM_SIZE
| Constructor Detail |
|---|
public FeaturizerME(FeaturizerModel model,
int beamSize)
model - The model for this featurizer.beamSize - The size of the beam that should be used when decoding sequences.public FeaturizerME(FeaturizerModel model)
model - | Method Detail |
|---|
public String[] featurize(String[] toks,
String[] tags)
Featurizer
featurize in interface Featurizertoks - an array of the tokens or words of the sequence.tags - an array of the pos tags of the sequence.
public opennlp.tools.util.Sequence[] topKSequences(String[] sentence,
String[] tags)
Featurizer
topKSequences in interface Featurizersentence - The tokens of the sentence.tags - The pos-tags for the specified sentence.
public opennlp.tools.util.Sequence[] topKSequences(String[] sentence,
String[] tags,
double minSequenceScore)
Featurizer
topKSequences in interface Featurizersentence - The tokens of the sentence.tags - The pos-tags for the specified sentence.minSequenceScore - A lower bound on the score of a returned sequence.
public void probs(double[] probs)
chunk. The specified array should be at least as large as the
numbe of tokens in the previous call to chunk.
probs - An array used to hold the probabilities of the last decoded
sequence.public double[] probs()
chunk.
chunk when it was last called.
public static FeaturizerModel train(String lang,
opennlp.tools.util.ObjectStream<FeatureSample> in,
opennlp.tools.util.TrainingParameters mlParams,
FeaturizerFactory factory)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||