use of com.joliciel.jochre.graphics.JochreCorpusShapeReader in project jochre by urieli.
the class Jochre method doCommandEvaluateSplits.
/**
* Evaluate the letter splitting model on its own.
*
* @param criteria
* the criteria used to select the evaluation corpus
*/
public void doCommandEvaluateSplits(CorpusSelectionCriteria criteria) throws IOException {
ClassificationModel splitModel = jochreSession.getSplitModel();
if (splitModel == null)
throw new IllegalArgumentException("Missing parameter: jochre.image-analyser.split-model");
List<String> splitFeatureDescriptors = splitModel.getFeatureDescriptors();
SplitFeatureParser splitFeatureParser = new SplitFeatureParser();
Set<SplitFeature<?>> splitFeatures = splitFeatureParser.getSplitFeatureSet(splitFeatureDescriptors);
SplitCandidateFinder splitCandidateFinder = new SplitCandidateFinder(jochreSession);
splitCandidateFinder.setMinDistanceBetweenSplits(5);
ShapeSplitter shapeSplitter = new RecursiveShapeSplitter(splitCandidateFinder, splitFeatures, splitModel.getDecisionMaker(), jochreSession);
JochreCorpusShapeReader shapeReader = new JochreCorpusShapeReader(jochreSession);
shapeReader.setSelectionCriteria(criteria);
SplitEvaluator splitEvaluator = new SplitEvaluator(jochreSession);
FScoreCalculator<String> fScoreCalculator = splitEvaluator.evaluate(shapeReader, shapeSplitter);
LOG.debug("" + fScoreCalculator.getTotalFScore());
}
use of com.joliciel.jochre.graphics.JochreCorpusShapeReader in project jochre by urieli.
the class JochreSplitEventStream method initialiseStream.
void initialiseStream() {
if (shapeReader == null) {
shapeReader = new JochreCorpusShapeReader(jochreSession);
shapeReader.setSelectionCriteria(criteria);
this.getNextShape();
}
}
Aggregations