| Modifier and Type | Field and Description | 
|---|---|
static int | 
DEFAULT_BEAM_SIZE  | 
| Constructor and Description | 
|---|
POSTaggerME(POSModel model)
Initializes the current instance with the provided model. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static Dictionary | 
buildNGramDictionary(ObjectStream<POSSample> samples,
                    int cutoff)  | 
String[] | 
getAllPosTags()
Retrieves an array of all possible part-of-speech tags from the
 tagger. 
 | 
String[] | 
getOrderedTags(List<String> words,
              List<String> tags,
              int index)  | 
String[] | 
getOrderedTags(List<String> words,
              List<String> tags,
              int index,
              double[] tprobs)  | 
static void | 
populatePOSDictionary(ObjectStream<POSSample> samples,
                     MutableTagDictionary dict,
                     int cutoff)  | 
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. 
 | 
String[][] | 
tag(int numTaggings,
   String[] sentence)
Returns at most the specified number of taggings for the specified sentence. 
 | 
String[] | 
tag(String[] sentence)
Assigns the sentence of tokens pos tags. 
 | 
String[] | 
tag(String[] sentence,
   Object[] additionaContext)  | 
Sequence[] | 
topKSequences(String[] sentence)  | 
Sequence[] | 
topKSequences(String[] sentence,
             Object[] additionaContext)  | 
static POSModel | 
train(String languageCode,
     ObjectStream<POSSample> samples,
     TrainingParameters trainParams,
     POSTaggerFactory posFactory)  | 
public static final int DEFAULT_BEAM_SIZE
public POSTaggerME(POSModel model)
model - public String[] getAllPosTags()
public String[] tag(String[] sentence)
POSTaggerpublic String[][] tag(int numTaggings, String[] sentence)
numTaggings - The number of tagging to be returned.sentence - An array of tokens which make up a sentence.public Sequence[] topKSequences(String[] sentence)
topKSequences in interface POSTaggerpublic Sequence[] topKSequences(String[] sentence, Object[] additionaContext)
topKSequences in interface POSTaggerpublic void probs(double[] probs)
probs - An array to put the probabilities into.public double[] probs()
public String[] getOrderedTags(List<String> words, List<String> tags, int index, double[] tprobs)
public static POSModel train(String languageCode, ObjectStream<POSSample> samples, TrainingParameters trainParams, POSTaggerFactory posFactory) throws IOException
IOExceptionpublic static Dictionary buildNGramDictionary(ObjectStream<POSSample> samples, int cutoff) throws IOException
IOExceptionpublic static void populatePOSDictionary(ObjectStream<POSSample> samples, MutableTagDictionary dict, int cutoff) throws IOException
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.