public SenseInstance(Constituent predicate, SenseManager manager) { this.predicate = predicate; this.manager = manager; predicateLemma = predicate.getAttribute(PredicateArgumentView.LemmaIdentifier); }
public Constituent cloneForNewViewWithDestinationLabel(String newViewName, String Dlabel) { Constituent cloneC = new Constituent(this.labelsToScores, Dlabel, this.getConstituentScore(), newViewName, this.getTextAnnotation(), this.getStartSpan(), this.getEndSpan()); for (String k : this.getAttributeKeys()) { cloneC.addAttribute(k, this.getAttribute(k)); } return cloneC; }
public SRLMulticlassInstance(Constituent c, Constituent predicate, SRLManager manager) { this.c = c; this.predicate = predicate; this.manager = manager; predicateLemma = predicate.getAttribute(PredicateArgumentView.LemmaIdentifier); features = new ConcurrentHashMap<>(); }
public Constituent cloneForNewViewWithDestinationLabel(String newViewName, String Dlabel) { Constituent cloneC = new Constituent(this.labelsToScores, Dlabel, this.getConstituentScore(), newViewName, this.getTextAnnotation(), this.getStartSpan(), this.getEndSpan()); for (String k : this.getAttributeKeys()) { cloneC.addAttribute(k, this.getAttribute(k)); } return cloneC; }
public String discreteValue(Object __example) { if (!(__example instanceof Constituent)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'bio_label(Constituent)' defined on line 9 of md.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Constituent c = (Constituent) __example; return "" + (c.getAttribute("BIO")); }
public String discreteValue(Object __example) { if (!(__example instanceof Constituent)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'bio_label(Constituent)' defined on line 9 of md.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Constituent c = (Constituent) __example; return "" + (c.getAttribute("BIO")); }
public String getPredicateSense(Constituent predicate) { if (predicate.hasAttribute(SenseIdentifer)) return predicate.getAttribute(SenseIdentifer); else return ""; }
public String getTokenAttribute(int tokenId, String key) { Constituent c = getConstituentAtToken(tokenId); if (c == null) return null; return c.getAttribute(key); }
public String discreteValue(Object __example) { if (!(__example instanceof Relation)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'headLevel(Relation)' defined on line 67 of extent.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Relation r = (Relation) __example; return "" + (r.getTarget().getAttribute("EntityMentionType")); }
public String getTokenAttribute(int tokenId, String key) { Constituent c = getConstituentAtToken(tokenId); if (c == null) return null; return c.getAttribute(key); }
public String getPredicateSense(Constituent predicate) { if (predicate.hasAttribute(SenseIdentifer)) return predicate.getAttribute(SenseIdentifer); else return ""; }
public String discreteValue(Object __example) { if (!(__example instanceof Relation)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'headLevel(Relation)' defined on line 67 of extent.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Relation r = (Relation) __example; return "" + (r.getTarget().getAttribute("EntityMentionType")); }
public static Constituent getPredictedMentionHead(Constituent c){ return new Constituent(c.getLabel(), "HEAD", c.getTextAnnotation(), Integer.parseInt(c.getAttribute("EntityHeadStartSpan")), Integer.parseInt(c.getAttribute("EntityHeadEndSpan"))); }
public static Constituent getPredictedMentionHead(Constituent c){ return new Constituent(c.getLabel(), "HEAD", c.getTextAnnotation(), Integer.parseInt(c.getAttribute("EntityHeadStartSpan")), Integer.parseInt(c.getAttribute("EntityHeadEndSpan"))); }
public static Constituent getPredictedMentionHead(Constituent c){ return new Constituent(c.getLabel(), "HEAD", c.getTextAnnotation(), Integer.parseInt(c.getAttribute("EntityHeadStartSpan")), Integer.parseInt(c.getAttribute("EntityHeadEndSpan"))); }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { Set<Feature> set = new LinkedHashSet<>(); if (c.hasAttribute(attributeName)) { set.add(DiscreteFeature.create(c.getAttribute(attributeName))); } return set; }
public String getPredicateLemma(Constituent predicate) { if (predicate.hasAttribute(LemmaIdentifier)) return predicate.getAttribute(LemmaIdentifier); else return predicate.getTokenizedSurfaceForm().toLowerCase().trim(); }
public String getPredicateLemma(Constituent predicate) { if (predicate.hasAttribute(LemmaIdentifier)) return predicate.getAttribute(LemmaIdentifier); else return predicate.getTokenizedSurfaceForm().toLowerCase().trim(); }
private String getLemma(Constituent c) { if (c.hasAttribute(PredicateArgumentView.LemmaIdentifier)) { return c.getAttribute(PredicateArgumentView.LemmaIdentifier); } else if (c.getTextAnnotation().hasView(ViewNames.LEMMA)) { return WordHelpers.getLemma(c.getTextAnnotation(), c.getEndSpan() - 1); } else return null; }
private String getLemma(Constituent c) { if (c.hasAttribute(PredicateArgumentView.LemmaIdentifier)) { return c.getAttribute(PredicateArgumentView.LemmaIdentifier); } else if (c.getTextAnnotation().hasView(ViewNames.LEMMA)) { return WordHelpers.getLemma(c.getTextAnnotation(), c.getEndSpan() - 1); } else return null; }