TextAnnotation ta = view.getTextAnnotation(); if (view.getNumberOfConstituents() == 0) { return ta.getText();
if (parser.equals("Berkeley")) parserView += ViewNames.PARSE_BERKELEY; if (parser.equals("Stanford")) parserView += ViewNames.PARSE_STANFORD; if (ta.getView(parserView).getNumberOfConstituents() != ta.getSentence(0).size()) { log.error("Head-dependency mismatch, removing sentence from dataset"); SentenceDBHandler.instance.removeTextAnnotation(ta);
for (int i = 0; i < view.getNumberOfConstituents(); i++) { Constituent constituent = constituents.get(i); JsonObject c = new JsonObject();
for (int i = 0; i < view.getNumberOfConstituents(); i++) { Constituent constituent = constituents.get(i); JsonObject c = new JsonObject();
ta.addView(posAnnotator); mentionAnnotator.addView(ta); total_labeled += ta.getView(ViewNames.MENTION_ACE).getNumberOfConstituents(); total_predicted += ta.getView(ViewNames.MENTION).getNumberOfConstituents(); for (Constituent pc : ta.getView(ViewNames.MENTION).getConstituents()){ for (Constituent gc : ta.getView(ViewNames.MENTION_ACE).getConstituents()){
ta.addView(posAnnotator); mentionAnnotator.addView(ta); total_labeled += ta.getView(ViewNames.MENTION_ACE).getNumberOfConstituents(); total_predicted += ta.getView(ViewNames.MENTION).getNumberOfConstituents(); for (Constituent pc : ta.getView(ViewNames.MENTION).getConstituents()){ for (Constituent gc : ta.getView(ViewNames.MENTION_ACE).getConstituents()){
ta.addView(posAnnotator); mentionAnnotator.addView(ta); total_labeled += ta.getView(ViewNames.MENTION_ACE).getNumberOfConstituents(); total_predicted += ta.getView(ViewNames.MENTION).getNumberOfConstituents(); for (Constituent pc : ta.getView(ViewNames.MENTION).getConstituents()){ for (Constituent gc : ta.getView(ViewNames.MENTION_ACE).getConstituents()){
ta.addView(posAnnotator); mentionAnnotator.addView(ta); total_labeled += ta.getView(ViewNames.MENTION_ACE).getNumberOfConstituents(); total_predicted += ta.getView(ViewNames.MENTION).getNumberOfConstituents(); for (Constituent pc : ta.getView(ViewNames.MENTION).getConstituents()){ for (Constituent gc : ta.getView(ViewNames.MENTION_ACE).getConstituents()){
ta.addView(posAnnotator); mentionAnnotator.addView(ta); total_labeled += ta.getView(ViewNames.MENTION_ERE).getNumberOfConstituents(); total_predicted += ta.getView(ViewNames.MENTION).getNumberOfConstituents(); for (Constituent pc : ta.getView(ViewNames.MENTION).getConstituents()){ for (Constituent gc : ta.getView(ViewNames.MENTION_ERE).getConstituents()){