@Override public Set<Feature> getFeatures(Constituent instance) throws EdisonException { Set<Feature> features = new LinkedHashSet<>(); TextAnnotation ta = instance.getTextAnnotation(); SpanLabelView shallowParse = (SpanLabelView) ta.getView(viewName); List<Constituent> lsc = shallowParse.getConstituentsCovering(instance); if (lsc.size() == 0) { features.add(N); } else { for (Constituent c : lsc) if (c.getTokenizedSurfaceForm().equals(contained) || c.getLabel().equals(contained)) features.add(Y); } return features; } }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { TextAnnotation ta = c.getTextAnnotation(); SpanLabelView shallowParse = (SpanLabelView) ta.getView(viewName); List<Constituent> lsc = shallowParse.getConstituentsCovering(c); Set<Feature> features = new LinkedHashSet<>(); if (lsc.size() == 0) { features.add(N); } else { for (Constituent chunk : lsc) { if (property.transform(chunk)) { features.add(Y); break; } } } return features; }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { TextAnnotation ta = c.getTextAnnotation(); SpanLabelView shallowParse = (SpanLabelView) ta.getView(viewName); List<Constituent> lsc = shallowParse.getConstituentsCovering(c); Set<Feature> features = new LinkedHashSet<>(); if (lsc.size() == 0) { features.add(N); } else { for (Constituent chunk : lsc) { if (property.transform(chunk)) { features.add(Y); break; } } } return features; }
public String getNamedEntityTag(Constituent c) { // We don't have gold NER SpanLabelView nerView = (SpanLabelView) s.ta.getView(ViewNames.NER_CONLL); List<Constituent> NEs = nerView.getConstituentsCovering(c); String result = ""; /* * String result = NEs.size()==0? "NO-NER" : NEs.get(0).getLabel(); for(int i = 1; * i<NEs.size(); i++) result += "+" + NEs.get(i).getLabel(); */ for (Constituent ne : NEs) { if (!ne.getLabel().equals("MISC") && c.doesConstituentCover(ne) && (ne.getNumberOfTokens() >= 0.6 * c.getNumberOfTokens())) result += "+" + ne.getLabel(); } return result; }
public String getNamedEntityTag(Constituent c) { // We don't have gold NER SpanLabelView nerView = (SpanLabelView) s.ta.getView(ViewNames.NER_CONLL); List<Constituent> NEs = nerView.getConstituentsCovering(c); String result = ""; /* * String result = NEs.size()==0? "NO-NER" : NEs.get(0).getLabel(); for(int i = 1; * i<NEs.size(); i++) result += "+" + NEs.get(i).getLabel(); */ for (Constituent ne : NEs) { if (!ne.getLabel().equals("MISC") && c.doesConstituentCover(ne) && (ne.getNumberOfTokens() >= 0.6 * c.getNumberOfTokens())) result += "+" + ne.getLabel(); } return result; }
Sentence sentence = ta.getSentence(i); System.out.println(i+") "+sentence+"@"+sentence.getStartSpan()); List<Constituent> nerlabels = slv.getConstituentsCovering(sentence.getSentenceConstituent()); for (Constituent c : nerlabels) { System.out.println(" "+c.getTokenizedSurfaceForm()+"-"+c.getLabel());
Sentence sentence = ta.getSentence(i); System.out.println(i+") "+sentence+"@"+sentence.getStartSpan()); List<Constituent> nerlabels = slv.getConstituentsCovering(sentence.getSentenceConstituent()); for (Constituent c : nerlabels) { System.out.println(" "+c.getTokenizedSurfaceForm()+"-"+c.getLabel());
List<Constituent> clauses = clause.getConstituentsCovering(p); float ratio = 0; if (clauses.size() > 0) {
List<Constituent> clauses = clause.getConstituentsCovering(p); float ratio = 0; if (clauses.size() > 0) {