edu.illinois.cs.cogcomp.lbj.coref.features
Class EntityTypeFeatures

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.features.EntityTypeFeatures

public class EntityTypeFeatures
extends java.lang.Object

A collection of features related to the entity type of a mention or the relationship between the entity types of mentions. An entity type is one of "PER" (person), "ORG" (organization), "GPE" (Geo-Political Entity), "LOC" (location), "VEH" (vehicle), "FAC" (facility), or "WEA" (weapon).


Field Summary
private static java.util.Map<java.lang.String,java.lang.String> m_wneTypeBetterCache
           
 
Constructor Summary
protected EntityTypeFeatures()
          No need to construct collection of static features.
 
Method Summary
static java.lang.String doETypesMatch(CExample ex)
          Determines whether the entity types of two mentions match, as determined by getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention).
static java.lang.String doETypesMatch(CExample ex, boolean useCache)
          Determines whether the entity types of two mentions match, as determined by getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention).
static java.lang.String getEType(Mention m)
          Determines the entity type of the mention m.
static java.lang.String getEType(Mention m, boolean useCache)
          Determines the entity type of the mention m.
static java.lang.String getNameEType(Mention m)
          Determines the entity type of a mention, assuming that the mention is a proper name (ACE mention type "NAM").
static java.lang.String getNominalEType(Mention m)
          Determines the Entity Type of a mention, assuming that the mention is a common name phrase (ACE mention type "NOM").
static java.lang.String getPronounEType(Mention m)
          Determine the entity type of the mention, assuming it is a pronoun.
static java.lang.String predETypeOrProWord(CExample ex)
          Gets the predicted entity type, or the pronoun word if a pronoun.
static java.lang.String predETypeOrProWord(CExample ex, boolean useCache)
          Gets the predicted entity type, or the pronoun word if a pronoun.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_wneTypeBetterCache

private static java.util.Map<java.lang.String,java.lang.String> m_wneTypeBetterCache
Constructor Detail

EntityTypeFeatures

protected EntityTypeFeatures()
No need to construct collection of static features.

Method Detail

doETypesMatch

public static java.lang.String doETypesMatch(CExample ex)
Determines whether the entity types of two mentions match, as determined by getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention). No caching is used.

Parameters:
ex - The example containing the mentions in question.
Returns:
"true", "false", or "unknown".

doETypesMatch

public static java.lang.String doETypesMatch(CExample ex,
                                             boolean useCache)
Determines whether the entity types of two mentions match, as determined by getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention).

Parameters:
ex - The example containing the mentions in question.
useCache - Whether caching should be done.
Returns:
"true", "false", or "unknown".

getEType

public static java.lang.String getEType(Mention m)
Determines the entity type of the mention m. If the m_predwnEType caches the predicted entity type, return that value; otherwise, depending on the mention type, delegate to the appropriate method. In the case of "PRE", determine whether a proper noun based on case (if the document is case sensitive) or else try considering it as both a "NAM" and "NOM" and if only one returns non-"unknown", return that; finally, if both return a value, choose the value determined assuming it is a "NAM". Caching will not be done.

Parameters:
m - The mention whose entity type should be determined.
Returns:
The entity type: one of "PER" (person), "ORG" (organization), "GPE" (Geo-Political Entity), "LOC" (location), "VEH" (vehicle), "FAC" (facility), or "WEA" (weapon), or "unknown".

getEType

public static java.lang.String getEType(Mention m,
                                        boolean useCache)
Determines the entity type of the mention m. If the Mention.m_predwnEType caches the predicted entity type, return that value; otherwise, depending on the mention type, delegate to the appropriate method. In the case of "PRE", determine whether a proper noun based on case (if the document is case sensitive) or else try considering it as both a "NAM" and "NOM" and if only one returns non-"unknown", return that; finally, if both return a value, choose the value determined assuming it is a "NAM".

Parameters:
m - The mention whose entity type should be determined.
useCache - Whether caching should be done.
Returns:
The entity type: one of "PER" (person), "ORG" (organization), "GPE" (Geo-Political Entity), "LOC" (location), "VEH" (vehicle), "FAC" (facility), or "WEA" (weapon), or "unknown".

getNameEType

public static java.lang.String getNameEType(Mention m)
Determines the entity type of a mention, assuming that the mention is a proper name (ACE mention type "NAM"). Checks Various Gazetteers, including lists of first names, last names, honors, cities, states, countries, corporations, sports teams, and universities. In case of a conflict, "unknown" is returned.

Parameters:
m - A mention assumed to be a "NAM".
Returns:
The entity type: one of "PER" (person), "ORG" (organization), "GPE" (Geo-Political Entity), "LOC" (location), "VEH" (vehicle), "FAC" (facility), or "WEA" (weapon), or "unknown".

getNominalEType

public static java.lang.String getNominalEType(Mention m)
Determines the Entity Type of a mention, assuming that the mention is a common name phrase (ACE mention type "NOM"). Checks whether a hypernym of the phrase is one of "person", "political unit", "location", "organization", "weapon", "vehicle", "industrial plant", or "facility", and returns the appropriate entity type.

Parameters:
m - A mention assumed to be a "NOM".
Returns:
The entity type: one of "PER" (person), "ORG" (organization), "GPE" (Geo-Political Entity), "LOC" (location), "VEH" (vehicle), "FAC" (facility), or "WEA" (weapon), or "unknown".

getPronounEType

public static java.lang.String getPronounEType(Mention m)
Determine the entity type of the mention, assuming it is a pronoun. Does not attempt to distinguish amongst non-personal pronouns.

Parameters:
m - A mention assumed to be a "PRO".
Returns:
"PER" or "unknown".

predETypeOrProWord

public static java.lang.String predETypeOrProWord(CExample ex)
Gets the predicted entity type, or the pronoun word if a pronoun. Uses the predicted entity type computed using getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention). Uses the default mention types, which may be gold. Does not cache results.

Parameters:
ex - The example.
Returns:
For each mention, the predicted entity type, or, if the mention is a pronoun, the token, conjoined by "&&".

predETypeOrProWord

public static java.lang.String predETypeOrProWord(CExample ex,
                                                  boolean useCache)
Gets the predicted entity type, or the pronoun word if a pronoun. Uses the predicted entity type computed using getEType(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention). Uses the default mention types, which may be gold.

Parameters:
ex - The example.
useCache - Whether caching should be done.
Returns:
For each mention, the predicted entity type, or, if the mention is a pronoun, the token, conjoined by "&&".