public class HMMPOSTagger extends java.lang.Object implements POSTagger, java.io.Serializable
| Constructor and Description |
|---|
HMMPOSTagger()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static HMMPOSTagger |
fit(java.lang.String[][] sentences,
PennTreebankPOS[][] labels)
Fits an HMM POS tagger by maximum likelihood estimation.
|
static HMMPOSTagger |
getDefault()
Returns the default English POS tagger.
|
static void |
main(java.lang.String[] argvs)
Train the default model on WSJ and BROWN datasets.
|
static void |
read(java.lang.String dir,
java.util.List<java.lang.String[]> sentences,
java.util.List<PennTreebankPOS[]> labels)
Load training data from a corpora.
|
PennTreebankPOS[] |
tag(java.lang.String[] sentence)
Tags the sentence in the form of a sequence of words
|
static void |
walkin(java.io.File dir,
java.util.List<java.io.File> files)
Recursive function to descend into the directory tree and find all the files
that end with ".POS"
|
public HMMPOSTagger()
public static HMMPOSTagger getDefault()
public PennTreebankPOS[] tag(java.lang.String[] sentence)
POSTaggerpublic static HMMPOSTagger fit(java.lang.String[][] sentences, PennTreebankPOS[][] labels)
public static void read(java.lang.String dir,
java.util.List<java.lang.String[]> sentences,
java.util.List<PennTreebankPOS[]> labels)
dir - a file object defining the top directorypublic static void walkin(java.io.File dir,
java.util.List<java.io.File> files)
dir - a file object defining the top directorypublic static void main(java.lang.String[] argvs)