edu.stanford.nlp.ie.machinereading.structure
Class EntityMention
java.lang.Object
edu.stanford.nlp.ie.machinereading.structure.ExtractionObject
edu.stanford.nlp.ie.machinereading.structure.EntityMention
- All Implemented Interfaces:
- java.io.Serializable
public class EntityMention
- extends ExtractionObject
Each entity mention is described by a type (possibly subtype) and a span of text
- Author:
- Andrey Gusev, Mihai
- See Also:
- Serialized Form
|
Constructor Summary |
EntityMention(java.lang.String objectId,
CoreMap sentence,
Span extentSpan,
Span headSpan,
java.lang.String type,
java.lang.String subtype,
java.lang.String mentionType)
|
| Methods inherited from class edu.stanford.nlp.ie.machinereading.structure.ExtractionObject |
attributeMap, concatenateTypes, getDocumentId, getExtent, getExtentString, getExtentTokenEnd, getExtentTokenStart, getFullValue, getObjectId, getSentence, getSpan, getSubType, getType, getTypeProbabilities, printableObject, setExtent, setSentence, setType, setTypeProbabilities, sortByExtent |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EntityMention
public EntityMention(java.lang.String objectId,
CoreMap sentence,
Span extentSpan,
Span headSpan,
java.lang.String type,
java.lang.String subtype,
java.lang.String mentionType)
getCorefID
public java.lang.String getCorefID()
setCorefID
public void setCorefID(java.lang.String id)
getMentionType
public java.lang.String getMentionType()
getHead
public Span getHead()
getHeadTokenStart
public int getHeadTokenStart()
getHeadTokenEnd
public int getHeadTokenEnd()
setHeadTokenSpan
public void setHeadTokenSpan(Span s)
setHeadTokenPosition
public void setHeadTokenPosition(int i)
getSyntacticHeadTokenPosition
public int getSyntacticHeadTokenPosition()
getSyntacticHeadToken
public CoreLabel getSyntacticHeadToken()
getSyntacticHeadTree
public Tree getSyntacticHeadTree()
getNormalizedName
public java.lang.String getNormalizedName()
setNormalizedName
public void setNormalizedName(java.lang.String n)
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals in class ExtractionObject
headIncludes
public boolean headIncludes(EntityMention otherEnt,
boolean useSubType)
equals
public boolean equals(EntityMention otherEnt,
boolean useSubType)
labelEquals
public boolean labelEquals(EntityMention otherEnt,
boolean useSubType)
- Compares the labels of the two mentions
- Parameters:
otherEnt - useSubType -
textEquals
public boolean textEquals(EntityMention otherEnt)
- Compares the text spans of the two entity mentions
- Parameters:
otherEnt -
getValue
public java.lang.String getValue()
- Get the text value of this entity.
The headTokenSpan MUST be set before calling this method!
- Overrides:
getValue in class ExtractionObject
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
sortByHeadSpan
public static void sortByHeadSpan(java.util.List<EntityMention> mentions)
makeUniqueId
public static java.lang.String makeUniqueId()
- Creates a new unique id for an entity mention
- Returns:
- the new id
Stanford NLP Group