@Test public void testEvaluator() throws IOException { ResourceAsStreamFactory inPredicted = new ResourceAsStreamFactory( getClass(), "/opennlp/tools/chunker/output.txt"); ResourceAsStreamFactory inExpected = new ResourceAsStreamFactory(getClass(), "/opennlp/tools/chunker/output.txt"); DummyChunkSampleStream predictedSample = new DummyChunkSampleStream( new PlainTextByLineStream(inPredicted, StandardCharsets.UTF_8), true); DummyChunkSampleStream expectedSample = new DummyChunkSampleStream( new PlainTextByLineStream(inExpected, StandardCharsets.UTF_8), false); Chunker dummyChunker = new DummyChunker(predictedSample); OutputStream stream = new ByteArrayOutputStream(); ChunkerEvaluationMonitor listener = new ChunkEvaluationErrorListener(stream); ChunkerEvaluator evaluator = new ChunkerEvaluator(dummyChunker, listener); evaluator.evaluate(expectedSample); FMeasure fm = evaluator.getFMeasure(); Assert.assertEquals(0.8d, fm.getPrecisionScore(), DELTA); Assert.assertEquals(0.875d, fm.getRecallScore(), DELTA); Assert.assertNotSame(stream.toString().length(), 0); }
public FMeasure getFMeasure() { return fmeasure; }
ChunkerEvaluator extends Evaluator<ChunkSample> { public FMeasure getFMeasure() { return fmeasure; } }
ChunkerEvaluator extends Evaluator<ChunkSample> { public FMeasure getFMeasure() { return fmeasure; } ChunkerEvaluator(Chunker chunker, ChunkerEvaluationMonitor... listeners); }
ChunkerEvaluator extends Evaluator<ChunkSample> { public FMeasure getFMeasure() { return fmeasure; } ChunkerEvaluator(Chunker chunker, ChunkerEvaluationMonitor... listeners); FMeasure getFMeasure(); }
ChunkerEvaluator extends Evaluator<ChunkSample> { public FMeasure getFMeasure() { return fmeasure; } ChunkerEvaluator(Chunker chunker, ChunkerEvaluationMonitor... listeners); FMeasure getFMeasure();  }