edu.stanford.nlp.dcoref
Class CorefChain

java.lang.Object
  extended by edu.stanford.nlp.dcoref.CorefChain
All Implemented Interfaces:
java.io.Serializable

public class CorefChain
extends java.lang.Object
implements java.io.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
static class CorefChain.CorefMention
          Mention for coref output.
protected static class CorefChain.MentionComparator
           
 
Constructor Summary
CorefChain(CorefCluster c, java.util.Map<Mention,IntTuple> positions)
           
CorefChain(int cid, java.util.Map<IntPair,java.util.Set<CorefChain.CorefMention>> mentionMap, CorefChain.CorefMention representative)
          Constructor required by CustomAnnotationSerializer
 
Method Summary
 boolean equals(java.lang.Object aThat)
           
 int getChainID()
           
 java.util.Map<IntPair,java.util.Set<CorefChain.CorefMention>> getMentionMap()
           
 java.util.List<CorefChain.CorefMention> getMentionsInTextualOrder()
          get List of CorefMentions
 java.util.Set<CorefChain.CorefMention> getMentionsWithSameHead(int sentenceNumber, int headIndex)
          get CorefMention by position
 java.util.Set<CorefChain.CorefMention> getMentionsWithSameHead(IntPair position)
          get CorefMentions by position (sentence number, headIndex) Can be multiple mentions sharing headword
 CorefChain.CorefMention getRepresentativeMention()
          Return the most representative mention in the chain.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CorefChain

public CorefChain(CorefCluster c,
                  java.util.Map<Mention,IntTuple> positions)

CorefChain

public CorefChain(int cid,
                  java.util.Map<IntPair,java.util.Set<CorefChain.CorefMention>> mentionMap,
                  CorefChain.CorefMention representative)
Constructor required by CustomAnnotationSerializer

Method Detail

equals

public boolean equals(java.lang.Object aThat)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getMentionsInTextualOrder

public java.util.List<CorefChain.CorefMention> getMentionsInTextualOrder()
get List of CorefMentions


getMentionsWithSameHead

public java.util.Set<CorefChain.CorefMention> getMentionsWithSameHead(IntPair position)
get CorefMentions by position (sentence number, headIndex) Can be multiple mentions sharing headword


getMentionsWithSameHead

public java.util.Set<CorefChain.CorefMention> getMentionsWithSameHead(int sentenceNumber,
                                                                      int headIndex)
get CorefMention by position


getMentionMap

public java.util.Map<IntPair,java.util.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()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Stanford NLP Group