|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcc.mallet.fst.SimpleTagger
public class SimpleTagger
This class's main method trains, tests, or runs a generic CRF-based sequence tagger.
Training and test files consist of blocks of lines, one block for each instance,
separated by blank lines. Each block of lines should have the first form
specified for the input of SimpleTagger.SimpleTaggerSentence2FeatureVectorSequence.
A variety of command line options control the operation of the main program, as
described in the comments for main.
| Nested Class Summary | |
|---|---|
static class |
SimpleTagger.SimpleTaggerSentence2FeatureVectorSequence
Converts an external encoding of a sequence of elements with binary features to a FeatureVectorSequence. |
| Method Summary | |
|---|---|
static Sequence[] |
apply(Transducer model,
Sequence input,
int k)
Apply a transducer to an input sequence to produce the k highest-scoring output sequences. |
static void |
main(java.lang.String[] args)
Command-line wrapper to train, test, or run a generic CRF-based tagger. |
static void |
test(TransducerTrainer tt,
TransducerEvaluator eval,
InstanceList testing)
Test a transducer on the given test data, evaluating accuracy with the given evaluator |
static CRF |
train(InstanceList training,
InstanceList testing,
TransducerEvaluator eval,
int[] orders,
java.lang.String defaultLabel,
java.lang.String forbidden,
java.lang.String allowed,
boolean connected,
int iterations,
double var,
CRF crf)
Create and train a CRF model from the given training data, optionally testing it on the given test data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CRF train(InstanceList training,
InstanceList testing,
TransducerEvaluator eval,
int[] orders,
java.lang.String defaultLabel,
java.lang.String forbidden,
java.lang.String allowed,
boolean connected,
int iterations,
double var,
CRF crf)
training - training datatesting - test data (possibly null)eval - accuracy evaluator (possibly null)orders - label Markov orders (main and backoff)defaultLabel - default labelforbidden - regular expression specifying impossible label
transitions current,next
(null indicates no forbidden transitions)allowed - regular expression specifying allowed label transitions
(null indicates everything is allowed that is not forbidden)connected - whether to include even transitions not
occurring in the training data.iterations - number of training iterationsvar - Gaussian prior variance
public static void test(TransducerTrainer tt,
TransducerEvaluator eval,
InstanceList testing)
model - a Transducereval - accuracy evaluatortesting - test data
public static Sequence[] apply(Transducer model,
Sequence input,
int k)
model - the Transducerinput - the input sequencek - the number of answers to return
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - the command line arguments. Options (shell and Java quoting should be added as needed):
--help booleantrue for longer documentation. Default is false.--prefix-code Java-code--gaussian-variance positive-number--train booleanfalse.--iterations positive-integer--test lab or seg=start-1.continue-1,...,start-n.continue-n--training-proportion number-between-0-and-1--model-file filename--random-seed integer--orders comma-separated-integers--forbidden regular-expression,label-2 matches the expression, the corresponding transition is forbidden. Default is \\s (nothing forbidden).--allowed regular-expression,label-2 does not match the expression, the corresponding expression is forbidden. Default is .* (everything allowed).--default-label stringO.--viterbi-output booleanfalse.--fully-connected booleantrue.--weights sparse|some-dense|densesome-dense.--n-best positive-integer--include-input booleanfalse.--threads positive-integerjava.lang.Exception - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||