|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.tools.postag.POSTaggerME
public class POSTaggerME
A part-of-speech tagger that uses maximum entropy. Tries to predict whether words are nouns, verbs, or any of 70 other POS tags depending on their surrounding context.
Field Summary | |
---|---|
static int |
DEFAULT_BEAM_SIZE
|
Constructor Summary | |
---|---|
POSTaggerME(AbstractModel model,
Dictionary dict)
Deprecated. |
|
POSTaggerME(AbstractModel model,
Dictionary dict,
TagDictionary tagdict)
Deprecated. |
|
POSTaggerME(AbstractModel model,
POSContextGenerator cg)
Deprecated. |
|
POSTaggerME(AbstractModel model,
POSContextGenerator cg,
TagDictionary tagdict)
Deprecated. |
|
POSTaggerME(AbstractModel model,
TagDictionary tagdict)
Deprecated. |
|
POSTaggerME(int beamSize,
AbstractModel model,
POSContextGenerator cg,
TagDictionary tagdict)
Deprecated. |
|
POSTaggerME(POSModel model)
Initializes the current instance with the provided model and the default beam size of 3. |
|
POSTaggerME(POSModel model,
int beamSize,
int cacheSize)
Initializes the current instance with the provided model and provided beam size. |
Method Summary | |
---|---|
int |
getNumTags()
Returns the number of different tags predicted by this model. |
java.lang.String[] |
getOrderedTags(java.util.List<java.lang.String> words,
java.util.List<java.lang.String> tags,
int index)
|
java.lang.String[] |
getOrderedTags(java.util.List<java.lang.String> words,
java.util.List<java.lang.String> tags,
int index,
double[] tprobs)
|
double[] |
probs()
Returns an array with the probabilities for each tag of the last tagged sentence. |
void |
probs(double[] probs)
Populates the specified array with the probabilities for each tag of the last tagged sentence. |
java.lang.String[][] |
tag(int numTaggings,
java.lang.String[] sentence)
Returns at most the specified number of taggings for the specified sentence. |
java.util.List<java.lang.String> |
tag(java.util.List<java.lang.String> sentence)
Deprecated. |
java.lang.String |
tag(java.lang.String sentence)
Deprecated. |
java.lang.String[] |
tag(java.lang.String[] sentence)
Assigns the sentence of tokens pos tags. |
Sequence[] |
topKSequences(java.util.List<java.lang.String> sentence)
Deprecated. |
Sequence[] |
topKSequences(java.lang.String[] sentence)
|
static POSModel |
train(java.lang.String languageCode,
ObjectStream<POSSample> samples,
ModelType modelType,
POSDictionary tagDictionary,
Dictionary ngramDictionary,
int cutoff,
int iterations)
|
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 POSTaggerME(POSModel model)
model
- public POSTaggerME(POSModel model, int beamSize, int cacheSize)
model
- beamSize
- @Deprecated public POSTaggerME(AbstractModel model, TagDictionary tagdict)
model
- The model used for tagging.tagdict
- The tag dictionary used for specifying a set of valid tags.@Deprecated public POSTaggerME(AbstractModel model, Dictionary dict)
model
- The model used for tagging.dict
- The n-gram dictionary used for feature generation.@Deprecated public POSTaggerME(AbstractModel model, Dictionary dict, TagDictionary tagdict)
model
- The model used for tagging.dict
- The n-gram dictionary used for feature generation.tagdict
- The dictionary which specifies the valid set of tags for some words.@Deprecated public POSTaggerME(AbstractModel model, POSContextGenerator cg)
model
- The model used for tagging.cg
- The context generator used for feature creation.@Deprecated public POSTaggerME(AbstractModel model, POSContextGenerator cg, TagDictionary tagdict)
model
- The model used for tagging.cg
- The context generator used for feature creation.tagdict
- The dictionary which specifies the valid set of tags for some words.@Deprecated public POSTaggerME(int beamSize, AbstractModel model, POSContextGenerator cg, TagDictionary tagdict)
beamSize
- The number of alternate tagging considered when tagging.model
- The model used for tagging.cg
- The context generator used for feature creation.tagdict
- The dictionary which specifies the valid set of tags for some words.Method Detail |
---|
public int getNumTags()
@Deprecated public java.util.List<java.lang.String> tag(java.util.List<java.lang.String> sentence)
POSTagger
tag
in interface POSTagger
sentence
- The sentence of tokens to be tagged.
public java.lang.String[] tag(java.lang.String[] sentence)
POSTagger
tag
in interface POSTagger
sentence
- The sentece of tokens to be tagged.
public java.lang.String[][] tag(int numTaggings, java.lang.String[] sentence)
numTaggings
- The number of tagging to be returned.sentence
- An array of tokens which make up a sentence.
@Deprecated public Sequence[] topKSequences(java.util.List<java.lang.String> sentence)
topKSequences
in interface POSTagger
public Sequence[] topKSequences(java.lang.String[] sentence)
topKSequences
in interface POSTagger
public void probs(double[] probs)
probs
- An array to put the probabilities into.public double[] probs()
@Deprecated public java.lang.String tag(java.lang.String sentence)
POSTagger
tag
in interface POSTagger
sentence
- The sentece of space-delimited tokens to be tagged.
public java.lang.String[] getOrderedTags(java.util.List<java.lang.String> words, java.util.List<java.lang.String> tags, int index)
public java.lang.String[] getOrderedTags(java.util.List<java.lang.String> words, java.util.List<java.lang.String> tags, int index, double[] tprobs)
public static POSModel train(java.lang.String languageCode, ObjectStream<POSSample> samples, ModelType modelType, POSDictionary tagDictionary, Dictionary ngramDictionary, int cutoff, int iterations) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |