Search in sources :

Example 1 with JochreCorpusGroupReader

use of com.joliciel.jochre.graphics.JochreCorpusGroupReader in project jochre by urieli.

the class JochreLetterEventStream method initialiseStream.

void initialiseStream() {
    if (groupReader == null) {
        groupReader = new JochreCorpusGroupReader(jochreSession);
        groupReader.setSelectionCriteria(criteria);
        this.getNextGroup();
    }
}
Also used : JochreCorpusGroupReader(com.joliciel.jochre.graphics.JochreCorpusGroupReader)

Example 2 with JochreCorpusGroupReader

use of com.joliciel.jochre.graphics.JochreCorpusGroupReader 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());
}
Also used : MergeFeatureParser(com.joliciel.jochre.boundaries.features.MergeFeatureParser) MergeEvaluator(com.joliciel.jochre.boundaries.MergeEvaluator) MergeFeature(com.joliciel.jochre.boundaries.features.MergeFeature) TrainingCorpusShapeMerger(com.joliciel.jochre.boundaries.TrainingCorpusShapeMerger) ShapeMerger(com.joliciel.jochre.boundaries.ShapeMerger) ClassificationModel(com.joliciel.talismane.machineLearning.ClassificationModel) JochreCorpusGroupReader(com.joliciel.jochre.graphics.JochreCorpusGroupReader)

Example 3 with JochreCorpusGroupReader

use of com.joliciel.jochre.graphics.JochreCorpusGroupReader in project jochre by urieli.

the class JochreMergeEventStream method initialiseStream.

void initialiseStream() {
    if (groupReader == null) {
        groupReader = new JochreCorpusGroupReader(jochreSession);
        groupReader.setSelectionCriteria(criteria);
        if (groupReader.hasNext())
            group = groupReader.next();
    }
}
Also used : JochreCorpusGroupReader(com.joliciel.jochre.graphics.JochreCorpusGroupReader)

Aggregations

JochreCorpusGroupReader (com.joliciel.jochre.graphics.JochreCorpusGroupReader)3 MergeEvaluator (com.joliciel.jochre.boundaries.MergeEvaluator)1 ShapeMerger (com.joliciel.jochre.boundaries.ShapeMerger)1 TrainingCorpusShapeMerger (com.joliciel.jochre.boundaries.TrainingCorpusShapeMerger)1 MergeFeature (com.joliciel.jochre.boundaries.features.MergeFeature)1 MergeFeatureParser (com.joliciel.jochre.boundaries.features.MergeFeatureParser)1 ClassificationModel (com.joliciel.talismane.machineLearning.ClassificationModel)1