/** * Adds the constituents provided in the arguments, with {@link Relation}s connecting the * canonical mention to the coreferent mentions. * @param canonicalMention the 'most explicit' descriptor of the underlying entity * @param coreferentMentions mentions that co-refer with the canonical mention */ public void addCorefEdges(Constituent canonicalMention, List<Constituent> coreferentMentions) { double[] scores = new double[coreferentMentions.size()]; Arrays.fill(scores, 1.0); addCorefEdges(canonicalMention, coreferentMentions, scores); }
/** * Adds the constituents provided in the arguments, with {@link Relation}s connecting the * canonical mention to the coreferent mentions. * @param canonicalMention the 'most explicit' descriptor of the underlying entity * @param coreferentMentions mentions that co-refer with the canonical mention */ public void addCorefEdges(Constituent canonicalMention, List<Constituent> coreferentMentions) { double[] scores = new double[coreferentMentions.size()]; Arrays.fill(scores, 1.0); addCorefEdges(canonicalMention, coreferentMentions, scores); }
@Override protected void addView(TextAnnotation ta) throws AnnotatorException { Annotation document = new Annotation(ta.text); pipeline.annotate(document); CoreferenceView vu = new CoreferenceView(viewName, ta); Map corefChain = document.get(CorefCoreAnnotations.CorefChainAnnotation.class); for (Object key : corefChain.keySet()) { CorefChain chain = (CorefChain) corefChain.get(key); Constituent representative = createConstituentGivenMention(document,chain,chain.getRepresentativeMention(), ta); List<Constituent> consList = new ArrayList<>(); for(CorefChain.CorefMention m : chain.getMentionsInTextualOrder()) { consList.add(createConstituentGivenMention(document, chain, m, ta)); } consList.remove(representative); // remove the representative itself vu.addCorefEdges(representative, consList); } ta.addView(viewName, vu); }
otherMents.add(corefMent); cView.addCorefEdges(canonical, otherMents);
otherMents.add(corefMent); cView.addCorefEdges(canonical, otherMents);
logger.debug(" "+cm+" -> "+cm.constituent.getSurfaceForm()); corefView.addCorefEdges(headconst, referants, attributes);
logger.debug(" "+cm+" -> "+cm.constituent.getSurfaceForm()); corefView.addCorefEdges(headconst, referants, attributes);
view.addCorefEdges(canonicalMention, coreferentMentions, scores);
corefExtentView.addCorefEdges(canonicalMention, corefMentions, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id); corefHeadView.addCorefEdges(canonicalMention, corefMentionHeads, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id);
view.addCorefEdges(canonicalMention, coreferentMentions, scores);
view.addCorefEdges(canonicalMention, coreferentMentions, scores);
corefExtentView.addCorefEdges(canonicalMention, corefMentions, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id); corefHeadView.addCorefEdges(canonicalMention, corefMentionHeads, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id);
corefExtentView.addCorefEdges(canonicalMention, corefMentions, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id); corefHeadView.addCorefEdges(canonicalMention, corefMentionHeads, scores); } else { logger.error("No Entity Mentions found for a given entity - " + entity.id);