public Set<Constituent> getCanonicalEntitiesViaRelations() { HashSet<Constituent> canonicalConstituents = new HashSet<>(); for (Constituent cc : this.getConstituents()) { canonicalConstituents.add(getCanonicalEntityViaRelation(cc)); } return canonicalConstituents; }
public Set<Constituent> getCanonicalEntitiesViaRelations() { HashSet<Constituent> canonicalConstituents = new HashSet<>(); for (Constituent cc : this.getConstituents()) { canonicalConstituents.add(getCanonicalEntityViaRelation(cc)); } return canonicalConstituents; }
this.gold = (CoreferenceView) goldView; this.prediction = (CoreferenceView) predictionView; List<Constituent> allGoldConstituents = gold.getConstituents(); for (Constituent cons : allGoldConstituents) { HashSet<Constituent> overlappingGoldCanonicalCons =
private void buildIndexFromRealCoref () { CoreferenceView corefView = (CoreferenceView)globalTA.getTa().getView(ViewNames.COREF); for(Constituent source : corefView.getConstituents()) { Constituent target = corefView.getCanonicalEntity(source); // String mention = source.getSurfaceString(); int start = source.getStartCharOffset(); int end = source.getEndCharOffset(); // String coreMention = target.getSurfaceString(); int corefStart = target.getStartCharOffset(); int corefEnd = target.getEndCharOffset(); predCorefStartMap.put(start, new Pair<Integer, Integer>(corefStart, corefEnd)); predCorefEndMap.put(end, new Pair<Integer, Integer>(corefStart, corefEnd)); if (isDebug) { String checkCoreference = contentRemovingTags.substring(corefStart, corefEnd); String checkMention = contentRemovingTags.substring(start, end); System.out.println ("[Mention] " + checkMention + " [Coref org] " + checkCoreference); } } }
this.gold = (CoreferenceView) goldView; this.prediction = (CoreferenceView) predictionView; List<Constituent> allGoldConstituents = gold.getConstituents(); for (Constituent cons : allGoldConstituents) { HashSet<Constituent> overlappingGoldCanonicalCons =
private void buildIndexFromRealCoref () { CoreferenceView corefView = (CoreferenceView)globalTA.getTa().getView(ViewNames.COREF); for(Constituent source : corefView.getConstituents()) { Constituent target = corefView.getCanonicalEntity(source); // String mention = source.getSurfaceString(); int start = source.getStartCharOffset(); int end = source.getEndCharOffset(); // String coreMention = target.getSurfaceString(); int corefStart = target.getStartCharOffset(); int corefEnd = target.getEndCharOffset(); predCorefStartMap.put(start, new Pair<Integer, Integer>(corefStart, corefEnd)); predCorefEndMap.put(end, new Pair<Integer, Integer>(corefStart, corefEnd)); if (isDebug) { String checkCoreference = contentRemovingTags.substring(corefStart, corefEnd); String checkMention = contentRemovingTags.substring(start, end); System.out.println ("[Mention] " + checkMention + " [Coref org] " + checkCoreference); } } }
/** * Finds the representative elements for each cluster */ @Deprecated private void findCanonicalEntries() { if (this.canonicalEntitiesMap.size() > 0 || !this.modified) return; // The assumption is that all nodes with no parent are canonical entities. for (Constituent cc : this.getConstituents()) { int ccId = this.constituents.indexOf(cc); if (getFilteredIncomingRelations(cc).size() == 0) { canonicalEntitiesMap.put(ccId, ccId); for (Relation r : getFilteredOutgoingRelations(cc)) { int tId = this.constituents.indexOf(r.getTarget()); canonicalEntitiesMap.put(tId, ccId); } } } modified = false; }
/** * Finds the representative elements for each cluster */ @Deprecated private void findCanonicalEntries() { if (this.canonicalEntitiesMap.size() > 0 || !this.modified) return; // The assumption is that all nodes with no parent are canonical entities. for (Constituent cc : this.getConstituents()) { int ccId = this.constituents.indexOf(cc); if (getFilteredIncomingRelations(cc).size() == 0) { canonicalEntitiesMap.put(ccId, ccId); for (Relation r : getFilteredOutgoingRelations(cc)) { int tId = this.constituents.indexOf(r.getTarget()); canonicalEntitiesMap.put(tId, ccId); } } } modified = false; }
for (Constituent c : corefView.getConstituents()) { this.setMentionType(c, tv, posView);
for (Constituent c : corefView.getConstituents()) { this.setMentionType(c, tv, posView);
CoreferenceView gold = (CoreferenceView) goldView; CoreferenceView prediction = (CoreferenceView) predictionView; List<Constituent> allGoldConstituents = gold.getConstituents(); for (Constituent cons1 : allGoldConstituents) { HashSet<Constituent> coreferents1gold =
CoreferenceView gold = (CoreferenceView) goldView; CoreferenceView prediction = (CoreferenceView) predictionView; List<Constituent> allGoldConstituents = gold.getConstituents(); for (Constituent cons1 : allGoldConstituents) { HashSet<Constituent> coreferents1gold =