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.static voidTrain the default model on WSJ and BROWN datasets.static voidLoad training data from a corpora.Tags the sentence in the form of a sequence of words.static voidRecursive function to descend into the directory tree and find all the files that end with ".POS"
-
Constructor Details
-
HMMPOSTagger
public HMMPOSTagger()Constructor. Creates an empty model. For Serialization only.
-
-
Method Details
-
getDefault
Returns the default English POS tagger.- Returns:
- the default English POS tagger
-
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.
-
read
Load training data from a corpora.- Parameters:
dir- the top directory of training data.sentences- the output list of training sentences.labels- the output list of training labels.
-
walkin
-
main
Train the default model on WSJ and BROWN datasets.- Parameters:
args- the command line arguments.
-