Counter<String> correct = new ClassicCounter<String>();
Counter<String> predicted = new ClassicCounter<String>();
Counter<String> gold = new ClassicCounter<String>();
for (int i = 0; i < goldStandard.size(); i++) {
CoreMap goldSent = goldStandard.get(i);
CoreMap sysSent = extractorOutput.get(i);
String sysText = sysSent.get(TextAnnotation.class);
String goldText = goldSent.get(TextAnnotation.class);
if (verbose) {
System.err.println("SCORING THE FOLLOWING SENTENCE:");
System.err.println(sysSent.get(CoreAnnotations.TokensAnnotation.class));
}
HashSet<String> matchedGolds = new HashSet<String>();
List<EntityMention> goldEntities = goldSent
.get(MachineReadingAnnotations.EntityMentionsAnnotation.class);
if (goldEntities == null) {
goldEntities = new ArrayList<EntityMention>();
}
for (EntityMention m : goldEntities) {
String label = makeLabel(m);
if (excludedClasses != null && excludedClasses.contains(label))
continue;
gold.incrementCount(label);
}
List<EntityMention> sysEntities = sysSent
.get(MachineReadingAnnotations.EntityMentionsAnnotation.class);
if (sysEntities == null) {
sysEntities = new ArrayList<EntityMention>();
}
for (EntityMention m : sysEntities) {