|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.illinois.cs.cogcomp.lbj.coref.ir.Mention
public class Mention
Represents the ACE mention of some ACE entity in the context of a document.
A mention has a head (its head noun phrase) and an extent
(the largest noun phrase headed by the head),
along with some metadata.
Generally, Mention
s should be used as singletons,
constructed only in the loading of a document, primarily stored in
and retrieved from a Doc
.
Thus, classes should store and manipulate references to an
Mention
rather than making copies.
Field Summary | |
---|---|
private java.util.Set<Mention> |
m_corefMents
|
private Doc |
m_doc
|
private java.lang.String |
m_entityType
|
private Chunk |
m_extent
|
private Chunk |
m_head
|
private java.lang.String |
m_id
|
boolean |
m_isTrueMention
|
private java.lang.String |
m_ldcAtr
|
private java.lang.String |
m_ldcType
|
private java.lang.String |
m_predEntityID
|
char |
m_predGender
|
char |
m_predNumber
|
java.lang.String |
m_predwnEType
|
private java.lang.String |
m_role
|
private java.lang.String |
m_specificity
|
private java.lang.String |
m_subtype
|
private java.lang.String |
m_trueEntityID
|
private java.lang.String |
m_type
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
Mention(Doc d,
Chunk headAndExtent)
A basic constructor that assumes the head and the extent are identical. |
|
Mention(Doc d,
java.lang.String id,
java.lang.String type,
java.lang.String ldcType,
java.lang.String ldcAtr,
java.lang.String role,
Chunk extent,
Chunk head,
java.lang.String entityID,
java.lang.String entityType,
java.lang.String subtype,
java.lang.String specificity,
boolean isTrueMention)
A complete constructor. |
Method Summary | |
---|---|
void |
addCorefMent(Mention m)
Adds a mention to the set of mentions coreferential with this. |
void |
addCorefMentsOf(Mention m)
Adds all the mentions known (or believed) to be coreferential with m
to the set of mentions coreferential with this . |
int |
compareTo(Mention m)
Compare first by extent, then by head. |
boolean |
equals(java.lang.Object o)
equals and hashCode methods inspired by article hosted on Technofundo, called "Equals and Hash Code", by Manish Hatwalne Available as of Feb. |
java.util.Set<Mention> |
getCorefMents()
Gets the set of mentions known (or believed) to be coreferential with this mention. |
Doc |
getDoc()
Gets the document containing this mention. |
java.lang.String |
getEntityID()
Gets the entity ID. |
java.lang.String |
getEntityType()
Gets the entity type. |
Chunk |
getExtent()
Gets the ACE extent of this mention. |
int |
getExtentFirstWordNum()
Gets the position in the document of the first word in the extent. |
int |
getExtentLastWordNum()
Gets the position in the document of the last word in the extent. |
Chunk |
getHead()
Gets the ACE head of this mention. |
int |
getHeadFirstWordNum()
Gets the position in the document of the first word in the head. |
int |
getHeadLastWordNum()
Gets the position in the document of the last word in the head. |
java.lang.String |
getID()
Gets the mention ID of this mention. |
java.lang.String |
getLdcAtr()
Get the LDC Attribute. |
java.lang.String |
getLdcType()
|
java.lang.String |
getPredictedEntityID()
Gets the predicted entity ID, which may be NONE. |
java.lang.String |
getPreHeadText()
Gets the text up to but not including the head. |
java.lang.String |
getRole()
Get the role. |
int |
getSentNum()
Gets the sentence number of the mention, which is defined as the sentence number of the first word in the head. |
java.lang.String |
getSpecificity()
Gets the specificity. |
java.lang.String |
getSubtype()
Gets the entity subtype for this mention. |
java.lang.String |
getText()
Gets the mention as a string, with vertical bars marking the head unless the extent and head are identical, and with newlines replaced by spaces. |
java.lang.String |
getThruHeadText()
Gets the text up to and including the head. |
java.lang.String |
getTrueEntityID()
Get the true entity ID. |
java.lang.String |
getType()
Gets the mention type. |
int |
hashCode()
Gets the hash code, which takes into account the hash codes of the head and extent, but NOT the ID or any other metadata. |
private void |
readObject(java.io.ObjectInputStream in)
Serialization read method. |
void |
setEntityType(java.lang.String type)
Sets the entity type. |
void |
setID(java.lang.String id)
Sets the mention ID. |
void |
setPredictedEntityID(java.lang.String id)
Sets the predicted entity ID. |
void |
setTrueEntityID(java.lang.String id)
Sets the true entity ID. |
void |
setType(java.lang.String type)
Sets the mention type. |
void |
stripID()
Strips all identifying info that would serve as a label for coreference. |
java.lang.String |
toFullString()
Gets the mention data as a full string, showing entity IDs. |
java.lang.String |
toFullString(boolean showEID)
Gets the mention data as a full string. |
java.lang.String |
toString()
Gets the mention as a string, with newlines replaced by spaces. |
private void |
writeObject(java.io.ObjectOutputStream out)
Serialization write method. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private Doc m_doc
private java.lang.String m_id
private java.lang.String m_type
private java.lang.String m_ldcType
private java.lang.String m_ldcAtr
private java.lang.String m_role
private Chunk m_head
private Chunk m_extent
private java.lang.String m_trueEntityID
private java.lang.String m_predEntityID
private java.lang.String m_entityType
private java.lang.String m_subtype
private java.lang.String m_specificity
public boolean m_isTrueMention
private transient java.util.Set<Mention> m_corefMents
public transient char m_predGender
public transient char m_predNumber
public transient java.lang.String m_predwnEType
Constructor Detail |
---|
public Mention(Doc d, java.lang.String id, java.lang.String type, java.lang.String ldcType, java.lang.String ldcAtr, java.lang.String role, Chunk extent, Chunk head, java.lang.String entityID, java.lang.String entityType, java.lang.String subtype, java.lang.String specificity, boolean isTrueMention)
d
- The document containing this mention.id
- The mention's ID.type
- The mention's mention type (NAM, NOM, PRE, or PRO).ldcType
- The LDC Type.ldcAtr
- The LDC Attribute.role
- The role.extent
- The extent of the mention.head
- The head of the mention.entityID
- The entity ID of the entity containing this mention
(PER, GPE, ORG, LOC, VEH, WEA, or FAC).subtype
- The entity sub-type.specificity
- The specificity (SPC or GEN).isTrueMention
- Whether the mention is true or predicted.public Mention(Doc d, Chunk headAndExtent)
d
- The document containing this mention.headAndExtent
- The head and the extent (assumed to be identical).Method Detail |
---|
public Chunk getHead()
public Chunk getExtent()
public Doc getDoc()
public int getHeadFirstWordNum()
public int getHeadLastWordNum()
public int getExtentFirstWordNum()
public int getExtentLastWordNum()
public int getSentNum()
public java.lang.String getID()
public void setID(java.lang.String id)
id
- The new ID.public java.lang.String getEntityID()
public java.lang.String getPredictedEntityID()
public void setPredictedEntityID(java.lang.String id)
id
- The new predicted entity ID.public java.lang.String getTrueEntityID()
public void setTrueEntityID(java.lang.String id)
id
- The true Entity ID.public void stripID()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- The mention type (NAM, NOM, PRE, PRO, or NONE).public java.lang.String getEntityType()
public void setEntityType(java.lang.String type)
type
- The entity type.public java.lang.String getSubtype()
public java.lang.String getLdcType()
public java.lang.String getSpecificity()
public java.lang.String getLdcAtr()
public java.lang.String getRole()
public java.util.Set<Mention> getCorefMents()
public void addCorefMent(Mention m)
m
- The mention coreferential with this.public void addCorefMentsOf(Mention m)
m
to the set of mentions coreferential with this
.
After this method is called, this.getCorefMents()
will also contain all the mentions in m.getCorefMents()
(in addition to any other mentions already included).
Note: Not all of this project records coreferential mentions
using this and related methods.
m
- The target mention.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(Mention m)
compareTo
in interface java.lang.Comparable<Mention>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toFullString()
public java.lang.String toFullString(boolean showEID)
showEID
- Whether the Entity IDs should be included.
public java.lang.String getText()
public java.lang.String getPreHeadText()
public java.lang.String getThruHeadText()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- The stream to write to.
java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- The stream to read from.
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |