Created
February 7, 2014 08:10
-
-
Save renaud/8858885 to your computer and use it in GitHub Desktop.
evaluate Mallet CRF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc.mallet.types.InstanceList.CrossValidationIterator crossValidationIt = trainingInstanceList.crossValidationIterator(folds, new Random().nextInt()); | |
while (crossValidationIt.hasNext()) { | |
InstanceList[] il = crossValidationIt.nextSplit(); | |
CRF crf = new CRF(trainingInstanceList.getPipe(), null); | |
CRFTrainerByThreadedLabelLikelihood trainer = new CRFTrainerByThreadedLabelLikelihood(crf, threads); | |
// CRFTrainerByLabelLikelihood trainer = new CRFTrainerByLabelLikelihood(crf); | |
MultiSegmentationEvaluator eval = new MyMultiSegmentationEvaluator(// | |
new InstanceList[] { testingSet }, new String[] { "TTesting" }, tags, continueTags); | |
trainer.addEvaluator(eval); | |
trainer.train(trainingSet); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment