|
||||||||||
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.AliasFeatures
public class AliasFeatures
Collection of feature generating functions that relate to aliases. For example features are provided to determine whether one mention is an initialism or acronym of the other, and to find the initials of a string.
Constructor Summary | |
---|---|
protected |
AliasFeatures()
No need to construct collection of features. |
Method Summary | |
---|---|
static boolean |
areSoonAlias(CExample ex)
Determines whether two mentions are aliases, as computed by the two parameter form of this method, and using gold Entity Types. |
static boolean |
areSoonAlias(CExample ex,
boolean useGoldEType)
Determines whether two mentions are aliases, as defined in Soon et al., Computational Linguistics, 2001. |
static boolean |
areSoonAlias(CExample ex,
boolean useGoldEType,
boolean useCache)
Determines whether two mentions are aliases, as defined in Soon et al., Computational Linguistics, 2001. |
static boolean |
areSoonAliasBetter(CExample ex,
boolean useGoldETypes)
Determines whether the mentions are aliases. |
static boolean |
doInitialsMatch(CExample ex)
Determines whether the heads of two mentions have the same initials. |
static boolean |
doInitialsMatchBetter(CExample ex)
Checks whether two mentions initials match. |
static boolean |
doInitialsMatchBetter(java.lang.String initials,
java.lang.String[] words)
Determines whether initials is the initials
corresponding to words . |
static boolean |
doLastNamesMatch(CExample ex,
boolean useGoldETypes)
Determines whether mentions have the same last name, if people. |
static java.lang.String |
getInitials(java.lang.String s)
Computes the initials of s . |
static java.lang.String |
getInitials(java.lang.String[] parts)
Computes the initials of parts, including a character for each non-stop word. |
static java.lang.String |
getSoonInitials(java.lang.String[] parts,
java.util.Set<java.lang.String> suffixes,
boolean useCase)
Computes the initials of parts , by returning a string
containing the first letter of each non-stop word, except that
suffixes are excluded and if useCase is
true only words beginning with an uppercase character are included. |
static java.lang.String |
getSoonInitials(java.lang.String s,
java.util.Set<java.lang.String> suffixes)
Computes the initials of the specified string. |
static boolean |
ignorable(java.lang.String w)
Determines whether a word can be ignored when computing initials or determining whether initials match. |
static boolean |
noETypeAlias(CExample ex)
Determine whether the mentions are aliases, without using entity types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AliasFeatures()
Method Detail |
---|
public static boolean areSoonAliasBetter(CExample ex, boolean useGoldETypes)
ex
- The exampleuseGoldETypes
- if true, uses mention's given entity types;
if false, gets entity types using EntityTypeFeatures
.
public static boolean noETypeAlias(CExample ex)
ex
- The example.
public static boolean doInitialsMatchBetter(CExample ex)
doInitialsMatchBetter(String, String[])
.
Words are split on non-alphanum, non-period characters.
ex
- The example
public static boolean doInitialsMatchBetter(java.lang.String initials, java.lang.String[] words)
initials
is the initials
corresponding to words
.
Non-word characters are ignored,
and any word that is ignorable
is optional.
initials
- A string representing the initials of some phrase.words
- The words whose initials will be computed and compared.
words
match initials
.public static boolean ignorable(java.lang.String w)
w
- A lowercase string.
w
is ignorable.public static boolean areSoonAlias(CExample ex)
ex
- The example whose mentions will be checked for relatedness.
public static boolean areSoonAlias(CExample ex, boolean useGoldEType)
ex
- The example whose mentions will be checked for relatedness.useGoldEType
- If true, use the gold Entity Type,
otherwise, predict it.
public static boolean areSoonAlias(CExample ex, boolean useGoldEType, boolean useCache)
ex
- The example whose mentions will be checked for relatedness.useGoldEType
- If true, use the gold Entity Type,
otherwise, predict it.useCache
- Whether to use the cached values for entity type as
determined by EntityTypeFeatures.getEType(Mention, boolean)
.
public static boolean doInitialsMatch(CExample ex)
getInitials(String s)
.
ex
- The example whose mentions will be compared.
public static java.lang.String getSoonInitials(java.lang.String s, java.util.Set<java.lang.String> suffixes)
suffixes
are excluded.
Uses smartcase (i.e. only words beginning with
an uppercase character are included when s
is
not all lowercase),
Splits s
on whitespace.
s
- The String whose initials will be computed.
getSoonInitials(String[], Set, boolean)
public static java.lang.String getSoonInitials(java.lang.String[] parts, java.util.Set<java.lang.String> suffixes, boolean useCase)
parts
, by returning a string
containing the first letter of each non-stop word, except that
suffixes
are excluded and if useCase
is
true only words beginning with an uppercase character are included.
parts
- An array of strings corresponding to words in a phrase.suffixes
- A Set of Strings not to be used to form initials in the
result.useCase
- When true, only include initials from words beginning
with an uppercase letter. (Result will still be lowercase).
public static java.lang.String getInitials(java.lang.String s)
s
.
public static java.lang.String getInitials(java.lang.String[] parts)
parts
- The words to compute initials on.
public static boolean doLastNamesMatch(CExample ex, boolean useGoldETypes)
ex
- The exampleuseGoldETypes
- if true, uses mention's given entity types;
if false, gets entity types using EntityTypeFeatures
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |