use of edu.illinois.cs.cogcomp.prepsrl.data.PrepSRLDataReader 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();
}
use of edu.illinois.cs.cogcomp.prepsrl.data.PrepSRLDataReader in project cogcomp-nlp by CogComp.
the class Main method test.
public void test() {
ConstrainedPrepSRLClassifier classifier = new ConstrainedPrepSRLClassifier();
Parser testDataReader = new PrepSRLDataReader(dataDir, "test");
TestDiscrete tester = new TestDiscrete();
TestDiscrete.testDiscrete(tester, classifier, new PrepSRLClassifier.Label(), testDataReader, true, 100);
testDataReader.close();
}
Aggregations