use of com.joliciel.jochre.boundaries.MergeEvaluator in project jochre by urieli.
the class Jochre method doCommandEvaluateMerge.
/**
* Evaluate the letter merging model on its own.
*
* @param criteria
* for selecting the portion of the corpus to evaluate
*/
public void doCommandEvaluateMerge(CorpusSelectionCriteria criteria) throws IOException {
ClassificationModel mergeModel = jochreSession.getMergeModel();
if (mergeModel == null)
throw new IllegalArgumentException("Missing parameter: jochre.image-analyser.merge-model");
List<String> mergeFeatureDescriptors = mergeModel.getFeatureDescriptors();
MergeFeatureParser mergeFeatureParser = new MergeFeatureParser();
Set<MergeFeature<?>> mergeFeatures = mergeFeatureParser.getMergeFeatureSet(mergeFeatureDescriptors);
JochreCorpusGroupReader groupReader = new JochreCorpusGroupReader(jochreSession);
groupReader.setSelectionCriteria(criteria);
ShapeMerger merger = new ShapeMerger(mergeFeatures, mergeModel.getDecisionMaker());
MergeEvaluator evaluator = new MergeEvaluator(jochreSession);
FScoreCalculator<String> fScoreCalculator = evaluator.evaluate(groupReader, merger);
LOG.debug("" + fScoreCalculator.getTotalFScore());
}
Aggregations