//SimplePipeline.runPipeline(collectionReader, builder.createAggregateDescription());
AnalysisEngineDescription aggregateDescription = builder.createAggregateDescription();
AnalysisEngine aggregate = builder.createAggregate();
AnnotationStatistics stats = new AnnotationStatistics();
for (JCas jCas : new JCasIterable(collectionReader, aggregate)) {
JCas goldView;
try {
goldView = jCas.getView(GOLD_VIEW_NAME);
} catch (CASException e) {
throw new AnalysisEngineProcessException(e);
}
Collection<IdentifiedAnnotation> goldEntities = new ArrayList<IdentifiedAnnotation>();
goldEntities.addAll(JCasUtil.select(goldView, EntityMention.class));
goldEntities.addAll(JCasUtil.select(goldView, EventMention.class));
Collection<IdentifiedAnnotation> systemEntities = new ArrayList<IdentifiedAnnotation>();
systemEntities.addAll(JCasUtil.select(jCas, EntityMention.class));
systemEntities.addAll(JCasUtil.select(jCas, EventMention.class));
stats.add(goldEntities, systemEntities,
AnnotationStatistics.<IdentifiedAnnotation>annotationToSpan(),
AnnotationStatistics.<IdentifiedAnnotation>annotationToFeatureValue("polarity"));
}
System.err.println(directory.getName() + ":");
System.err.println(stats);