edu.stanford.nlp.dcoref
Class Mention

java.lang.Object
  extended by edu.stanford.nlp.dcoref.Mention
All Implemented Interfaces:
CoreAnnotation<Mention>, TypesafeMap.Key<CoreMap,Mention>, java.io.Serializable

public class Mention
extends java.lang.Object
implements CoreAnnotation<Mention>, java.io.Serializable

One mention for the SieveCoreferenceSystem

Author:
Jenny Finkel, Karthik Raghunathan, Heeyoung Lee
See Also:
Serialized Form

Field Summary
 Dictionaries.Animacy animacy
           
 java.util.Set<Mention> appositions
          Set of other mentions in the same sentence that are syntactic appositions to this
 Tree contextParseTree
           
 int corefClusterID
           
 SemanticGraph dependency
           
 java.util.Set<java.lang.String> dependents
           
 IndexedWord dependingVerb
           
 int endIndex
           
 Dictionaries.Gender gender
           
 boolean generic
           
 int goldCorefClusterID
           
 int headIndex
           
 java.lang.String headString
           
 CoreLabel headWord
           
 boolean isDirectObject
           
 boolean isIndirectObject
           
 boolean isPrepositionObject
           
 boolean isSubject
           
 int mentionID
           
 Tree mentionSubTree
           
 Dictionaries.MentionType mentionType
           
 java.lang.String nerString
           
 Dictionaries.Number number
           
 int originalRef
           
 java.util.List<CoreLabel> originalSpan
           
 int paragraph
           
 Dictionaries.Person person
           
 java.util.Set<Mention> predicateNominatives
           
 java.util.List<java.lang.String> preprocessedTerms
           
 java.util.Set<Mention> relativePronouns
           
 java.util.List<CoreLabel> sentenceWords
           
 int sentNum
           
 int startIndex
           
 java.lang.Object synsets
           
 boolean twinless
           
 int utter
           
 
Constructor Summary
Mention()
           
Mention(int mentionID, int startIndex, int endIndex, SemanticGraph dependency)
           
Mention(int mentionID, int startIndex, int endIndex, SemanticGraph dependency, java.util.List<CoreLabel> mentionSpan)
           
Mention(int mentionID, int startIndex, int endIndex, SemanticGraph dependency, java.util.List<CoreLabel> mentionSpan, Tree mentionTree)
           
 
Method Summary
 void addApposition(Mention m)
          Find apposition
 void addPredicateNominatives(Mention m)
          Find predicate nominatives
 void addRelativePronoun(Mention m)
          Find relative pronouns
 boolean animaciesAgree(Mention m)
           
 boolean animaciesAgree(Mention m, boolean strict)
           
 boolean appearEarlierThan(Mention m)
          Find which mention appears first in a document
 boolean attributesAgree(Mention potentialAntecedent, Dictionaries dict)
          Detects if the mention and candidate antecedent agree on all attributes respectively.
 java.lang.String buildQueryText(java.util.List<java.lang.String> terms)
           
 boolean entityTypesAgree(Mention m, Dictionaries dict)
           
 boolean entityTypesAgree(Mention m, Dictionaries dict, boolean strict)
           
 boolean gendersAgree(Mention m)
           
 boolean gendersAgree(Mention m, boolean strict)
           
 java.lang.Class<Mention> getType()
          Returns the type associated with this annotation.
static boolean haveDifferentLocation(Mention m, Mention a, Dictionaries dict)
          Check whether two mentions have different locations
static boolean haveExtraProperNoun(Mention m, Mention a, java.util.Set<java.lang.String> exceptWords)
          Have extra proper noun except strings involved in semantic match
 boolean haveIncompatibleModifier(Mention ant)
          Check whether later mention has incompatible modifier
protected  boolean headsAgree(Mention m)
           
 boolean includedIn(Mention m)
          Verifies if this mention's tree is dominated by the tree of the given mention
 boolean insideIn(Mention m)
           
 boolean isAcronym(Mention m)
           
 boolean isApposition(Mention m)
          Check apposition
 boolean isDemonym(Mention m, Dictionaries dict)
           
 boolean isPredicateNominatives(Mention m)
          Check predicate nominatives
 boolean isPronominal()
           
 boolean isRelativePronoun(Mention m)
          Check relative pronouns
 boolean isRoleAppositive(Mention m, Dictionaries dict)
           
static boolean isSpeaker(Document document, Mention mention, Mention ant, Dictionaries dict)
           
protected  boolean isTheCommonNoun()
           
static boolean iWithini(Mention m1, Mention m2, Dictionaries dict)
          Check whether two mentions are in i-within-i relation (Chomsky, 1981)
 java.lang.String longestNNPEndsWithHead()
           
 java.lang.String lowestNPIncludesHead()
           
protected  boolean moreRepresentativeThan(Mention m)
           
static boolean numberInLaterMention(Mention mention, Mention ant)
          Check whether there is a new number in later mention
 boolean numbersAgree(Mention m)
           
static boolean personDisagree(Document document, Mention m, Mention ant, Dictionaries dict)
           
 java.util.List<java.lang.String> preprocessSearchTerm()
           
 void process(Dictionaries dict, Semantics semantics, MentionExtractor mentionExtractor)
          Set attributes of a mention: head string, mention type, NER label, Number, Gender, Animacy
static java.lang.String removeParenthesis(java.lang.String text)
           
 java.lang.String removePhraseAfterHead()
          Remove any clause after headword
static boolean sameProperHeadLastWord(Mention m, Mention a)
          Check whether two mentions have the same proper head words
 boolean sameSentence(Mention m)
           
static boolean sameSpeaker(Document document, Mention m, Mention ant)
           
 java.lang.String spanToString()
           
 java.lang.String stringWithoutArticle(java.lang.String str)
           
static boolean subjectObject(Mention m1, Mention m2)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mentionType

public Dictionaries.MentionType mentionType

number

public Dictionaries.Number number

gender

public Dictionaries.Gender gender

animacy

public Dictionaries.Animacy animacy

person

public Dictionaries.Person person

headString

public java.lang.String headString

nerString

public java.lang.String nerString

startIndex

public int startIndex

endIndex

public int endIndex

headIndex

public int headIndex

mentionID

public int mentionID

originalRef

public int originalRef

goldCorefClusterID

public int goldCorefClusterID

corefClusterID

public int corefClusterID

sentNum

public int sentNum

utter

public int utter

paragraph

public int paragraph

isSubject

public boolean isSubject

isDirectObject

public boolean isDirectObject

isIndirectObject

public boolean isIndirectObject

isPrepositionObject

public boolean isPrepositionObject

dependingVerb

public IndexedWord dependingVerb

twinless

public boolean twinless

generic

public boolean generic

sentenceWords

public java.util.List<CoreLabel> sentenceWords

originalSpan

public java.util.List<CoreLabel> originalSpan

mentionSubTree

public Tree mentionSubTree

contextParseTree

public Tree contextParseTree

headWord

public CoreLabel headWord

dependency

public SemanticGraph dependency

dependents

public java.util.Set<java.lang.String> dependents

preprocessedTerms

public java.util.List<java.lang.String> preprocessedTerms

synsets

public java.lang.Object synsets

appositions

public java.util.Set<Mention> appositions
Set of other mentions in the same sentence that are syntactic appositions to this


predicateNominatives

public java.util.Set<Mention> predicateNominatives

relativePronouns

public java.util.Set<Mention> relativePronouns
Constructor Detail

Mention

public Mention()

Mention

public Mention(int mentionID,
               int startIndex,
               int endIndex,
               SemanticGraph dependency)

Mention

public Mention(int mentionID,
               int startIndex,
               int endIndex,
               SemanticGraph dependency,
               java.util.List<CoreLabel> mentionSpan)

Mention

public Mention(int mentionID,
               int startIndex,
               int endIndex,
               SemanticGraph dependency,
               java.util.List<CoreLabel> mentionSpan,
               Tree mentionTree)
Method Detail

getType

public java.lang.Class<Mention> getType()
Description copied from interface: CoreAnnotation
Returns the type associated with this annotation. This method must return the same class type as its value type parameter. It feels like one should be able to get away without this method, but because Java erases the generic type signature, that info disappears at runtime.

Specified by:
getType in interface CoreAnnotation<Mention>

isPronominal

public boolean isPronominal()

toString

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

spanToString

public java.lang.String spanToString()

process

public void process(Dictionaries dict,
                    Semantics semantics,
                    MentionExtractor mentionExtractor)
             throws java.lang.Exception
Set attributes of a mention: head string, mention type, NER label, Number, Gender, Animacy

Throws:
java.lang.Exception

sameSentence

public boolean sameSentence(Mention m)

headsAgree

protected boolean headsAgree(Mention m)

numbersAgree

public boolean numbersAgree(Mention m)

gendersAgree

public boolean gendersAgree(Mention m)

gendersAgree

public boolean gendersAgree(Mention m,
                            boolean strict)

animaciesAgree

public boolean animaciesAgree(Mention m)

animaciesAgree

public boolean animaciesAgree(Mention m,
                              boolean strict)

entityTypesAgree

public boolean entityTypesAgree(Mention m,
                                Dictionaries dict)

entityTypesAgree

public boolean entityTypesAgree(Mention m,
                                Dictionaries dict,
                                boolean strict)

includedIn

public boolean includedIn(Mention m)
Verifies if this mention's tree is dominated by the tree of the given mention


attributesAgree

public boolean attributesAgree(Mention potentialAntecedent,
                               Dictionaries dict)
Detects if the mention and candidate antecedent agree on all attributes respectively.

Parameters:
potentialAntecedent -
Returns:
true if all attributes agree between both mention and candidate, else false.

addApposition

public void addApposition(Mention m)
Find apposition


isApposition

public boolean isApposition(Mention m)
Check apposition


addPredicateNominatives

public void addPredicateNominatives(Mention m)
Find predicate nominatives


isPredicateNominatives

public boolean isPredicateNominatives(Mention m)
Check predicate nominatives


addRelativePronoun

public void addRelativePronoun(Mention m)
Find relative pronouns


isRelativePronoun

public boolean isRelativePronoun(Mention m)
Check relative pronouns


isAcronym

public boolean isAcronym(Mention m)

isRoleAppositive

public boolean isRoleAppositive(Mention m,
                                Dictionaries dict)

isDemonym

public boolean isDemonym(Mention m,
                         Dictionaries dict)

iWithini

public static boolean iWithini(Mention m1,
                               Mention m2,
                               Dictionaries dict)
Check whether two mentions are in i-within-i relation (Chomsky, 1981)


haveIncompatibleModifier

public boolean haveIncompatibleModifier(Mention ant)
Check whether later mention has incompatible modifier


appearEarlierThan

public boolean appearEarlierThan(Mention m)
Find which mention appears first in a document


haveDifferentLocation

public static boolean haveDifferentLocation(Mention m,
                                            Mention a,
                                            Dictionaries dict)
Check whether two mentions have different locations


sameProperHeadLastWord

public static boolean sameProperHeadLastWord(Mention m,
                                             Mention a)
Check whether two mentions have the same proper head words


removePhraseAfterHead

public java.lang.String removePhraseAfterHead()
Remove any clause after headword


numberInLaterMention

public static boolean numberInLaterMention(Mention mention,
                                           Mention ant)
Check whether there is a new number in later mention


haveExtraProperNoun

public static boolean haveExtraProperNoun(Mention m,
                                          Mention a,
                                          java.util.Set<java.lang.String> exceptWords)
Have extra proper noun except strings involved in semantic match


longestNNPEndsWithHead

public java.lang.String longestNNPEndsWithHead()

lowestNPIncludesHead

public java.lang.String lowestNPIncludesHead()

stringWithoutArticle

public java.lang.String stringWithoutArticle(java.lang.String str)

preprocessSearchTerm

public java.util.List<java.lang.String> preprocessSearchTerm()

buildQueryText

public java.lang.String buildQueryText(java.util.List<java.lang.String> terms)

removeParenthesis

public static java.lang.String removeParenthesis(java.lang.String text)

isTheCommonNoun

protected boolean isTheCommonNoun()

isSpeaker

public static boolean isSpeaker(Document document,
                                Mention mention,
                                Mention ant,
                                Dictionaries dict)

personDisagree

public static boolean personDisagree(Document document,
                                     Mention m,
                                     Mention ant,
                                     Dictionaries dict)

sameSpeaker

public static boolean sameSpeaker(Document document,
                                  Mention m,
                                  Mention ant)

subjectObject

public static boolean subjectObject(Mention m1,
                                    Mention m2)

insideIn

public boolean insideIn(Mention m)

moreRepresentativeThan

protected boolean moreRepresentativeThan(Mention m)


Stanford NLP Group