Package edu.stanford.nlp.dcoref
Class CorefChain
- java.lang.Object
-
- edu.stanford.nlp.dcoref.CorefChain
-
- All Implemented Interfaces:
Serializable
public class CorefChain extends Object implements Serializable
Output of (deterministic) coref system. Each CorefChain represents a set of mentions in the text which should all correspond to the same actual entity. There is a representative mention, which stores the best mention of an entity, and then there is a List of all mentions that are coreferent with that mention. The mentionMap maps from pairs of a sentence number and a head word index to a CorefMention. The chainID is an arbitrary integer for the chain number.- Author:
- Heeyoung Lee
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCorefChain.CorefMentionMention for coref output.protected static classCorefChain.CorefMentionComparatorprotected static classCorefChain.MentionComparator
-
Constructor Summary
Constructors Constructor Description CorefChain(int cid, Map<IntPair,Set<CorefChain.CorefMention>> mentionMap, CorefChain.CorefMention representative)Constructor required by CustomAnnotationSerializerCorefChain(CorefCluster c, Map<Mention,IntTuple> positions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteMention(CorefChain.CorefMention m)Delete a mention from this coreference chain.booleanequals(Object aThat)intgetChainID()Map<IntPair,Set<CorefChain.CorefMention>>getMentionMap()List<CorefChain.CorefMention>getMentionsInTextualOrder()get List of CorefMentionsSet<CorefChain.CorefMention>getMentionsWithSameHead(int sentenceNumber, int headIndex)get CorefMention by positionSet<CorefChain.CorefMention>getMentionsWithSameHead(IntPair position)get CorefMentions by position (sentence number, headIndex) Can be multiple mentions sharing headwordCorefChain.CorefMentiongetRepresentativeMention()Return the most representative mention in the chain.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
CorefChain
public CorefChain(CorefCluster c, Map<Mention,IntTuple> positions)
-
CorefChain
public CorefChain(int cid, Map<IntPair,Set<CorefChain.CorefMention>> mentionMap, CorefChain.CorefMention representative)Constructor required by CustomAnnotationSerializer
-
-
Method Detail
-
getMentionsInTextualOrder
public List<CorefChain.CorefMention> getMentionsInTextualOrder()
get List of CorefMentions
-
getMentionsWithSameHead
public Set<CorefChain.CorefMention> getMentionsWithSameHead(IntPair position)
get CorefMentions by position (sentence number, headIndex) Can be multiple mentions sharing headword
-
getMentionsWithSameHead
public Set<CorefChain.CorefMention> getMentionsWithSameHead(int sentenceNumber, int headIndex)
get CorefMention by position
-
getMentionMap
public Map<IntPair,Set<CorefChain.CorefMention>> getMentionMap()
-
getRepresentativeMention
public CorefChain.CorefMention getRepresentativeMention()
Return the most representative mention in the chain. Proper mention and a mention with more pre-modifiers are preferred.
-
getChainID
public int getChainID()
-
deleteMention
public void deleteMention(CorefChain.CorefMention m)
Delete a mention from this coreference chain.- Parameters:
m- The mention to delete.
-
-