use of org.cogcomp.md.MentionAnnotator in project cogcomp-nlp by CogComp.
the class MentionDetectionTest method testHeadInference.
@Test
public void testHeadInference() {
EREMentionRelationReader ereMentionRelationReader = null;
try {
String path = "src/test/resources/ERE";
ereMentionRelationReader = new EREMentionRelationReader(EREDocumentReader.EreCorpus.ENR3, path, false);
POSAnnotator posAnnotator = new POSAnnotator();
MentionAnnotator mentionAnnotator = new MentionAnnotator();
for (XmlTextAnnotation xta : ereMentionRelationReader) {
TextAnnotation ta = xta.getTextAnnotation();
ta.addView(posAnnotator);
mentionAnnotator.addView(ta);
if (ta.getView("MENTION").getNumberOfConstituents() < 60) {
fail("Mention Head predicted performance dropped");
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations