|
||||||||||
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.features.GenderFeatures
public class GenderFeatures
A collection of feature generating functions and utilities for determining the gender of an entity.
Field Summary | |
---|---|
protected static java.util.Map<java.lang.String,java.lang.Character> |
m_genderCache
A Cache of genders. |
Constructor Summary | |
---|---|
protected |
GenderFeatures()
Should not need to construct this static library of features. |
Method Summary | |
---|---|
static java.lang.String |
doGendersMatch(CExample ex,
boolean useWN)
Determines whether the gender of two mentions match, according to getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean) . |
static java.lang.String |
doGendersMatch(CExample ex,
boolean useWN,
boolean useCache)
Determines whether the gender of two mentions match, according to getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean) . |
static java.lang.String |
doGendersMatchForBasic(CExample ex)
This is a legacy function for use as a feature for the learned classifier that predicts simple coreference, used to determine whether names match. |
static java.lang.String |
doGendersMatchForCompatible(CExample ex,
boolean useWN)
Determines the gender of a mention. |
static boolean |
genderMatchBoolean(CExample ex)
Determines whether the gender of two mentions match as determined by getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean) . |
static char |
getGender(Mention m,
boolean useWN)
Determines the gender of a mention. |
static char |
getGender(Mention m,
boolean useWN,
boolean useCache)
Determines the gender of a mention. |
static char |
getGenderForCompatible(Mention m)
Gets the gender of a mention. |
static char |
getNameGender(Mention m)
Determines the gender of a mention, assuming it is a proper name. |
static char |
getNameGenderCitiesFirst(Mention m)
Gets the gender of the mention, prioritizing cities over names (resolving cases where a name could either be a city or a person). |
static char |
getNominalGender(Mention m,
boolean useWN)
Determines the gender of a mention, assuming it is a nominal. |
static char |
getPronounGender(java.lang.String word)
Determines the gender of a mention, assuming it is a pronoun. |
static char |
getStrongerGender(char g1,
char g2)
Gets the stronger of the two genders. |
static java.lang.String |
removePunctuationFromEnds(java.lang.String s)
Trims punctuation from string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.Map<java.lang.String,java.lang.Character> m_genderCache
Constructor Detail |
---|
protected GenderFeatures()
Method Detail |
---|
public static boolean genderMatchBoolean(CExample ex)
getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean)
.
Returns a boolean value and assumes true if unknown.
ex
- The example containing the mentions.
public static java.lang.String doGendersMatch(CExample ex, boolean useWN)
getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean)
.
Caching is not done.
useWN
- Whether WordNet should be used to help predict genders?
public static java.lang.String doGendersMatch(CExample ex, boolean useWN, boolean useCache)
getGender(edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, boolean)
.
useWN
- Whether WordNet should be used to help predict genders?useCache
- Whether to cache genders.
public static char getGender(Mention m, boolean useWN)
m
- The mention whose gender to determine.useWN
- Whether WordNet should be used to help predict genders?
public static char getGender(Mention m, boolean useWN, boolean useCache)
m
- The mention whose gender to determine.useWN
- Whether WordNet should be used to help predict genders?useCache
- Whether to cache genders based on the head text.
public static java.lang.String doGendersMatchForCompatible(CExample ex, boolean useWN)
ex
- An example.useWN
- Whether WordNet should be used to help predict genders?
public static java.lang.String doGendersMatchForBasic(CExample ex)
ex
- An example.
public static char getGenderForCompatible(Mention m)
m
- A mention.
public static char getNameGenderCitiesFirst(Mention m)
m
- The mention, assumed to be a proper name.
public static char getNameGender(Mention m)
public static char getNominalGender(Mention m, boolean useWN)
public static char getPronounGender(java.lang.String word)
public static char getStrongerGender(char g1, char g2)
g1
- One gender ('m', 'f', 'p', or 'u').g2
- Another gender ('m', 'f', 'p', or 'u').
public static java.lang.String removePunctuationFromEnds(java.lang.String s)
s
- A String.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |