@Test public void testShorterPredictionSpans() throws Exception { ConstituentSpanSplittingEvaluator evaluator = new ConstituentSpanSplittingEvaluator(); evaluator.evaluate(splittingTester, prediction1, prediction2); assertEquals(0.73, splittingTester.getMicroF1(), 0.01); assertEquals(0.58, splittingTester.getMicroPrecision(), 0.03); }
public void evaluate(ClassificationTester tester, View gold, View prediction) { super.cleanAttributes(gold, prediction); Set<IntPair> goldSpans = new HashSet<>(); for (Constituent cons : gold.getConstituents()) { goldSpans.add(cons.getSpan()); } Set<IntPair> predictedSpans = new HashSet<>(); for (Constituent cons : prediction.getConstituents()) { predictedSpans.add(cons.getSpan()); } Set<IntPair> spanIntersection = new HashSet<>(goldSpans); spanIntersection.retainAll(predictedSpans); tester.recordCount("" , goldSpans.size(), predictedSpans.size(), spanIntersection.size()); }
ConstituentSpanSplittingEvaluator extends Evaluator { public void evaluate(ClassificationTester tester, View gold, View prediction) { super.cleanAttributes(gold, prediction); Set<IntPair> goldSpans = new HashSet<>(); for (Constituent cons : gold.getConstituents()) { goldSpans.add(cons.getSpan()); } Set<IntPair> predictedSpans = new HashSet<>(); for (Constituent cons : prediction.getConstituents()) { predictedSpans.add(cons.getSpan()); } Set<IntPair> spanIntersection = new HashSet<>(goldSpans); spanIntersection.retainAll(predictedSpans); tester.recordCount("" , goldSpans.size(), predictedSpans.size(), spanIntersection.size()); } }
ConstituentSpanSplittingEvaluator extends Evaluator { public void evaluate(ClassificationTester tester, View gold, View prediction) { super.cleanAttributes(gold, prediction); Set<IntPair> goldSpans = new HashSet<>(); for (Constituent cons : gold.getConstituents()) { goldSpans.add(cons.getSpan()); } Set<IntPair> predictedSpans = new HashSet<>(); for (Constituent cons : prediction.getConstituents()) { predictedSpans.add(cons.getSpan()); } Set<IntPair> spanIntersection = new HashSet<>(goldSpans); spanIntersection.retainAll(predictedSpans); tester.recordCount("" , goldSpans.size(), predictedSpans.size(), spanIntersection.size()); }  }
ConstituentSpanSplittingEvaluator extends Evaluator { public void evaluate(ClassificationTester tester, View gold, View prediction) { super.cleanAttributes(gold, prediction); Set<IntPair> goldSpans = new HashSet<>(); for (Constituent cons : gold.getConstituents()) { goldSpans.add(cons.getSpan()); } Set<IntPair> predictedSpans = new HashSet<>(); for (Constituent cons : prediction.getConstituents()) { predictedSpans.add(cons.getSpan()); } Set<IntPair> spanIntersection = new HashSet<>(goldSpans); spanIntersection.retainAll(predictedSpans); tester.recordCount("" , goldSpans.size(), predictedSpans.size(), spanIntersection.size()); }  void evaluate(ClassificationTester tester, View gold, View prediction); }
ConstituentSpanSplittingEvaluator extends Evaluator { public void evaluate(ClassificationTester tester, View gold, View prediction) { super.cleanAttributes(gold, prediction); Set<IntPair> goldSpans = new HashSet<>(); for (Constituent cons : gold.getConstituents()) { goldSpans.add(cons.getSpan()); } Set<IntPair> predictedSpans = new HashSet<>(); for (Constituent cons : prediction.getConstituents()) { predictedSpans.add(cons.getSpan()); } Set<IntPair> spanIntersection = new HashSet<>(goldSpans); spanIntersection.retainAll(predictedSpans); tester.recordCount("" , goldSpans.size(), predictedSpans.size(), spanIntersection.size()); }  void evaluate(ClassificationTester tester, View gold, View prediction);  }