Search in sources :

Example 1 with Learner

use of edu.illinois.cs.cogcomp.lbjava.learn.Learner in project cogcomp-nlp by CogComp.

the class Main method train.

public void train() {
    if (!IOUtils.exists(modelsDir))
        IOUtils.mkdir(modelsDir);
    Learner classifier = new PrepSRLClassifier(modelName + ".lc", modelName + ".lex");
    Parser trainDataReader = new PrepSRLDataReader(dataDir, "train");
    BatchTrainer trainer = new BatchTrainer(classifier, trainDataReader, 1000);
    trainer.train(20);
    classifier.save();
    trainDataReader.close();
}
Also used : BatchTrainer(edu.illinois.cs.cogcomp.lbjava.learn.BatchTrainer) ConstrainedPrepSRLClassifier(edu.illinois.cs.cogcomp.prepsrl.inference.ConstrainedPrepSRLClassifier) PrepSRLDataReader(edu.illinois.cs.cogcomp.prepsrl.data.PrepSRLDataReader) Learner(edu.illinois.cs.cogcomp.lbjava.learn.Learner) Parser(edu.illinois.cs.cogcomp.lbjava.parse.Parser)

Aggregations

BatchTrainer (edu.illinois.cs.cogcomp.lbjava.learn.BatchTrainer)1 Learner (edu.illinois.cs.cogcomp.lbjava.learn.Learner)1 Parser (edu.illinois.cs.cogcomp.lbjava.parse.Parser)1 PrepSRLDataReader (edu.illinois.cs.cogcomp.prepsrl.data.PrepSRLDataReader)1 ConstrainedPrepSRLClassifier (edu.illinois.cs.cogcomp.prepsrl.inference.ConstrainedPrepSRLClassifier)1