| 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
and the default beam size of 3.
|
POSTaggerME(POSModel model,
int beamSize,
int cacheSize)
Deprecated.
the beam size should be specified in the params during training
|
| Modifier and Type | Method and Description |
|---|---|
static Dictionary |
buildNGramDictionary(ObjectStream<POSSample> samples,
int cutoff) |
java.lang.String[] |
getAllPosTags()
Retrieves an array of all possible part-of-speech tags from the
tagger.
|
int |
getNumTags()
Deprecated.
use getAllPosTags instead!
|
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) |
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.
|
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.
|
java.lang.String[] |
tag(java.lang.String[] sentence,
java.lang.Object[] additionaContext) |
Sequence[] |
topKSequences(java.util.List<java.lang.String> sentence)
Deprecated.
|
Sequence[] |
topKSequences(java.lang.String[] sentence) |
Sequence[] |
topKSequences(java.lang.String[] sentence,
java.lang.Object[] additionaContext) |
static POSModel |
train(java.lang.String languageCode,
ObjectStream<POSSample> samples,
ModelType modelType,
POSDictionary tagDictionary,
Dictionary ngramDictionary,
int cutoff,
int iterations)
Deprecated.
use
train(String, ObjectStream, TrainingParameters, POSTaggerFactory)
instead and pass in a POSTaggerFactory and a
TrainingParameters. |
static POSModel |
train(java.lang.String languageCode,
ObjectStream<POSSample> samples,
TrainingParameters trainParams,
POSDictionary tagDictionary,
Dictionary ngramDictionary)
Deprecated.
use
train(String, ObjectStream, TrainingParameters, POSTaggerFactory)
instead and pass in a POSTaggerFactory. |
static POSModel |
train(java.lang.String languageCode,
ObjectStream<POSSample> samples,
TrainingParameters trainParams,
POSTaggerFactory posFactory) |
public static final int DEFAULT_BEAM_SIZE
@Deprecated public POSTaggerME(POSModel model, int beamSize, int cacheSize)
model - beamSize - public POSTaggerME(POSModel model)
model - @Deprecated public int getNumTags()
public java.lang.String[] getAllPosTags()
@Deprecated public java.util.List<java.lang.String> tag(java.util.List<java.lang.String> sentence)
POSTaggerpublic java.lang.String[] tag(java.lang.String[] sentence)
POSTaggerpublic java.lang.String[] tag(java.lang.String[] sentence,
java.lang.Object[] additionaContext)
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 POSTaggerpublic Sequence[] topKSequences(java.lang.String[] sentence)
topKSequences in interface POSTaggerpublic Sequence[] topKSequences(java.lang.String[] sentence, java.lang.Object[] additionaContext)
topKSequences in interface POSTaggerpublic 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)
POSTaggerpublic 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, TrainingParameters trainParams, POSTaggerFactory posFactory) throws java.io.IOException
java.io.IOExceptionpublic static POSModel train(java.lang.String languageCode, ObjectStream<POSSample> samples, TrainingParameters trainParams, POSDictionary tagDictionary, Dictionary ngramDictionary) throws java.io.IOException
train(String, ObjectStream, TrainingParameters, POSTaggerFactory)
instead and pass in a POSTaggerFactory.java.io.IOException@Deprecated 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
train(String, ObjectStream, TrainingParameters, POSTaggerFactory)
instead and pass in a POSTaggerFactory and a
TrainingParameters.java.io.IOExceptionpublic static Dictionary buildNGramDictionary(ObjectStream<POSSample> samples, int cutoff) throws java.io.IOException
java.io.IOExceptionpublic static void populatePOSDictionary(ObjectStream<POSSample> samples, MutableTagDictionary dict, int cutoff) throws java.io.IOException
java.io.IOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved