/** * Returns ALL the constituents in a single chain characterized by its canonical constituent */ public Set<Constituent> getCoreferentMentionsViaRelations(Constituent mention) { Set<Constituent> canonicalMentionSet = getCanonicalEntitySetViaRelation(mention); Set<Constituent> coreferentMentions = new HashSet<>(); for (Constituent c : canonicalMentionSet) { for (Relation r : getFilteredOutgoingRelations(c)) { coreferentMentions.add(r.target); } } coreferentMentions.addAll(canonicalMentionSet); return coreferentMentions; }
/** * Returns ALL the constituents in a single chain characterized by its canonical constituent */ public Set<Constituent> getCoreferentMentionsViaRelations(Constituent mention) { Set<Constituent> canonicalMentionSet = getCanonicalEntitySetViaRelation(mention); Set<Constituent> coreferentMentions = new HashSet<>(); for (Constituent c : canonicalMentionSet) { for (Relation r : getFilteredOutgoingRelations(c)) { coreferentMentions.add(r.target); } } coreferentMentions.addAll(canonicalMentionSet); return coreferentMentions; }
/** * Given a mention, it returns the list of canonical mentions of the coref chains which overlap * with the input constituent * * @param c the input constituent * @return canonical consittuents of the overlalpping chains with the input constituent */ public HashSet<Constituent> getOverlappingChainsCanonicalMentions(Constituent c) { List<Constituent> overlappingCons = c.getView().getConstituentsCovering(c); HashSet<Constituent> canonicalCons = new HashSet<>(); for (Constituent cc : overlappingCons) canonicalCons.addAll(getCanonicalEntitySetViaRelation(cc)); return canonicalCons; }
/** * Given a mention, it returns the list of canonical mentions of the coref chains which overlap * with the input constituent * * @param c the input constituent * @return canonical consittuents of the overlalpping chains with the input constituent */ public HashSet<Constituent> getOverlappingChainsCanonicalMentions(Constituent c) { List<Constituent> overlappingCons = c.getView().getConstituentsCovering(c); HashSet<Constituent> canonicalCons = new HashSet<>(); for (Constituent cc : overlappingCons) canonicalCons.addAll(getCanonicalEntitySetViaRelation(cc)); return canonicalCons; }