Class HMMPOSTagger
java.lang.Object
smile.nlp.pos.HMMPOSTagger
- All Implemented Interfaces:
Serializable, POSTagger
Part-of-speech tagging with hidden Markov model.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HMMPOSTaggerfit(String[][] sentences, PennTreebankPOS[][] labels) Fits an HMM POS tagger by maximum likelihood estimation.static HMMPOSTaggerReturns the default English POS tagger (thread-safe lazy initialization).static voidTrain the default model on WSJ and BROWN datasets.Tags the sentence in the form of a sequence of words.
-
Constructor Details
-
HMMPOSTagger
public HMMPOSTagger()Constructor. Creates an empty model. For serialization only.
-
-
Method Details
-
getDefault
Returns the default English POS tagger (thread-safe lazy initialization).- Returns:
- the default English POS tagger, or
nullif the model resource could not be loaded.
-
tag
Description copied from interface:POSTaggerTags the sentence in the form of a sequence of words. -
fit
Fits an HMM POS tagger by maximum likelihood estimation.- Parameters:
sentences- the training sentences.labels- the training labels.- Returns:
- the model.
-
main
Train the default model on WSJ and BROWN datasets.- Parameters:
args- the command line arguments.
-