edu.stanford.nlp.dcoref
Class Mention

java.lang.Object
  extended by edu.stanford.nlp.dcoref.Mention
All Implemented Interfaces:
CoreAnnotation<Mention>, TypesafeMap.Key<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, Marta Recasens
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
           
 IndexedWord headIndexedWord
           
 java.lang.String headString
           
 CoreLabel headWord
           
 boolean isDirectObject
           
 boolean isIndirectObject
           
 boolean isPrepositionObject
           
 boolean isSingleton
           
 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.
static 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.util.List<java.lang.String> getContext()
           
 int getCoordination()
           
 int getModal(Dictionaries dict)
           
 int getModifiers(Dictionaries dict)
           
 int getNegation(Dictionaries dict)
           
 java.lang.String getPattern()
           
 java.lang.String getPattern(java.util.List<CoreLabel> pTokens)
           
 java.lang.String getPosition()
           
 java.util.ArrayList<java.util.ArrayList<IndexedWord>> getPostmodifiers()
           
 java.util.List<java.lang.String> getPremodifierContext()
           
 java.util.ArrayList<java.util.ArrayList<IndexedWord>> getPremodifiers()
           
 java.lang.String getQuantification(Dictionaries dict)
           
 java.lang.String getRelation()
           
 int getReportEmbedding(Dictionaries dict)
           
 java.lang.String[] getSplitPattern()
           
 java.lang.Class<Mention> getType()
          Returns the type associated with this annotation.
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 isApposition(Mention m)
          Check apposition
 boolean isCoordinated()
           
 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)
           
protected  boolean isTheCommonNoun()
           
 java.lang.String longestNNPEndsWithHead()
           
 java.lang.String lowestNPIncludesHead()
           
 boolean moreRepresentativeThan(Mention m)
           
 boolean numbersAgree(Mention m)
           
 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
 void process(Dictionaries dict, Semantics semantics, MentionExtractor mentionExtractor, LogisticClassifier<java.lang.String,java.lang.String> singletonPredictor)
           
static java.lang.String removeParenthesis(java.lang.String text)
           
 java.lang.String removePhraseAfterHead()
          Remove any clause after headword
 boolean sameSentence(Mention m)
           
protected  void setNumber(Dictionaries dict, int[] genderNumberCount)
           
 java.lang.String spanToString()
           
 java.lang.String stringWithoutArticle(java.lang.String str)
           
 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

headIndexedWord

public IndexedWord headIndexedWord

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

isSingleton

public boolean isSingleton

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

process

public void process(Dictionaries dict,
                    Semantics semantics,
                    MentionExtractor mentionExtractor,
                    LogisticClassifier<java.lang.String,java.lang.String> singletonPredictor)
             throws java.lang.Exception
Throws:
java.lang.Exception

setNumber

protected void setNumber(Dictionaries dict,
                         int[] genderNumberCount)

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


appearEarlierThan

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


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 static java.lang.String buildQueryText(java.util.List<java.lang.String> terms)

removePhraseAfterHead

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


removeParenthesis

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

isTheCommonNoun

protected boolean isTheCommonNoun()

insideIn

public boolean insideIn(Mention m)

moreRepresentativeThan

public boolean moreRepresentativeThan(Mention m)

getPremodifiers

public java.util.ArrayList<java.util.ArrayList<IndexedWord>> getPremodifiers()

getPostmodifiers

public java.util.ArrayList<java.util.ArrayList<IndexedWord>> getPostmodifiers()

getSplitPattern

public java.lang.String[] getSplitPattern()

getPattern

public java.lang.String getPattern()

getPattern

public java.lang.String getPattern(java.util.List<CoreLabel> pTokens)

isCoordinated

public boolean isCoordinated()

getContext

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

getPremodifierContext

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

isRelativePronoun

public boolean isRelativePronoun(Mention m)
Check relative pronouns


isRoleAppositive

public boolean isRoleAppositive(Mention m,
                                Dictionaries dict)

isDemonym

public boolean isDemonym(Mention m,
                         Dictionaries dict)

getPosition

public java.lang.String getPosition()

getRelation

public java.lang.String getRelation()

getModifiers

public int getModifiers(Dictionaries dict)

getQuantification

public java.lang.String getQuantification(Dictionaries dict)

getNegation

public int getNegation(Dictionaries dict)

getModal

public int getModal(Dictionaries dict)

getReportEmbedding

public int getReportEmbedding(Dictionaries dict)

getCoordination

public int getCoordination()


Stanford NLP Group