|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.illinois.cs.cogcomp.lbj.coref.ir.examples.Example
edu.illinois.cs.cogcomp.lbj.coref.ir.examples.CExample
public class CExample
A coreference example (CExample) is a pair of referrers, where each referrer is either an entity mention or a set of entity mentions, and the document containing the mentions. A CExample is the input to classifiers that determine coreference.
Field Summary | |
---|---|
private java.util.Set<Mention> |
m_c1
|
private java.util.Set<Mention> |
m_c2
|
Doc |
m_doc
|
private Mention |
m_m1
|
private Mention |
m_m2
|
private boolean |
m_positive
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
CExample(Doc doc,
Mention m1,
Mention m2)
Construct a coreference example referring to mentions m1 and m2 in the context of doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
Mention m2)
Construct a coreference example referring to a cluster of mentions c1 and a mention m2
in the context of a document doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
Mention m2,
boolean positiveExample)
Construct a coreference example referring to a set of mentions c1 and a mention m2
in the context of a document doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
java.util.Set<Mention> c2)
Construct a coreference example referring to a set of mentions c1 and a set of mentions c2
in the context of a document doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
java.util.Set<Mention> c2,
boolean positiveExample)
Construct a coreference example referring to a set of mentions c1 and a set of mentions c2
in the context of a document doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
java.util.Set<Mention> c2,
Mention m1,
Mention m2)
Construct a coreference example referring to a set of mentions c1 and a set of mentions c2
in the context of a document doc . |
|
CExample(Doc doc,
java.util.Set<Mention> c1,
java.util.Set<Mention> c2,
Mention m1,
Mention m2,
boolean positiveExample)
Construct a coreference example referring to a set of mentions c1 and a set of mentions c2
in the context of a document doc . |
Method Summary | |
---|---|
boolean |
areCoreferent()
Assumes true knowledge has been given, either using a constructor, the settings of the EntityID labels, or using the setPositive() method. |
java.util.Set<Mention> |
getC1()
Gets the first set of mentions, if available. |
java.util.Set<Mention> |
getC2()
Gets the second set of mentions, if available. |
Doc |
getDoc()
Gets the document that provides context for the mentions in the example. |
Mention |
getM(int n)
Gets the specified mention. |
Mention |
getM1()
Gets the first mention, if available. |
Mention |
getM2()
Gets the second mention, if available. |
boolean |
isPositive()
Determines whether this is a positive example. |
void |
setPositive(boolean isPos)
This method may be used along with a constructor that does not take the coreference status as input to override the automatically determined result of the areCoreferent() method. |
java.lang.String |
toString()
Computes a string representation of this example. |
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.ir.examples.Example |
---|
getLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public Doc m_doc
private Mention m_m1
private Mention m_m2
private java.util.Set<Mention> m_c1
private java.util.Set<Mention> m_c2
private boolean m_positive
Constructor Detail |
---|
public CExample(Doc doc, Mention m1, Mention m2)
m1
and m2
in the context of doc
.
If mentions lack (true) EntityID, use setPositive()
or do not rely on areCoreferent().
doc
- The document containing the mentions.m1
- The first mention, which generally occurs
before m2
in the document.m2
- The second mention, which is the anaphor, and generally
occurs after m1
.public CExample(Doc doc, java.util.Set<Mention> c1, Mention m2)
c1
and a mention m2
in the context of a document doc
.
Used to determine whether m2
refers to the entity
represented by the mentions in c1
.
Cluster c1
and m2
are defined to be coreferential with
only if all mentions in c1
have the same entity ID as m2
.
In case c1 is empty, c1 and m2 will be considered coreferent.
If mentions lack (true) EntityID, use setPositive()
or do not rely on areCoreferent().
doc
- The document containing the mentions.c1
- The set of mentions thought to refer to an entity (copied defensively).
c1 must be non-emptym2
- The second mention, which is the anaphor.
java.lang.IllegalArgumentException
- if c1
is empty.public CExample(Doc doc, java.util.Set<Mention> c1, Mention m2, boolean positiveExample)
c1
and a mention m2
in the context of a document doc
.
Used to determine whether m2
refers to the entity
represented by the mentions in c1
.
doc
- The document containing the mentions.c1
- A set of mentions (copied defensively).m2
- The second mention, which is the anaphor.positiveExample
- Specify whether this example should be considered
a positive one.
java.lang.IllegalArgumentException
- if c1
is empty.public CExample(Doc doc, java.util.Set<Mention> c1, java.util.Set<Mention> c2)
c1
and a set of mentions c2
in the context of a document doc
.
Used to determine whether mentions in c2
refer to the same entity as the
the mentions in c1
.
(The exact criteria for coreference are left undefined --
whether this example is coreferential is specified
by setPositive()
.)
doc
- The document containing the mentions.c1
- A set of mentions (copied defensively).c2
- A second set of mentions (copied defensively).
java.lang.IllegalArgumentException
- if c1
or c2
is empty.public CExample(Doc doc, java.util.Set<Mention> c1, java.util.Set<Mention> c2, boolean positiveExample)
c1
and a set of mentions c2
in the context of a document doc
.
Used to determine whether mentions in c2
refer to the same entity as the
the mentions in c1
.
(The exact criteria for coreference are left undefined --
whether this example is coreferential is specified
by positiveExample
.)
doc
- The document containing the mentions.c1
- A set of mentions (copied defensively).c2
- A second set of mentions (copied defensively).positiveExample
- Specify whether this example should be considered
a positive one.
java.lang.IllegalArgumentException
- if c1
or c2
is empty.public CExample(Doc doc, java.util.Set<Mention> c1, java.util.Set<Mention> c2, Mention m1, Mention m2)
c1
and a set of mentions c2
in the context of a document doc
.
Used to determine whether mentions in c2
refer to the same entity as the
the mentions in c1
.
(The exact criteria for coreference are left undefined --
whether this example is coreferential is specified
by setPositive()
.)
doc
- The document containing the mentions.c1
- A set of mentions (copied defensively).c2
- A second set of mentions (copied defensively).m1
- The canonical mention of c1
.m2
- The canonical mention of c2
.
java.lang.IllegalArgumentException
- if c1
or c2
is empty.public CExample(Doc doc, java.util.Set<Mention> c1, java.util.Set<Mention> c2, Mention m1, Mention m2, boolean positiveExample)
c1
and a set of mentions c2
in the context of a document doc
.
Used to determine whether mentions in c2
refer to the same entity as the
the mentions in c1
.
(The exact criteria for coreference are left undefined --
whether this example is coreferential is specified
by positiveExample
.)
doc
- The document containing the mentions.c1
- A set of mentions.c2
- A second set of mentions.m1
- The canonical mention of c1
.m2
- The canonical mention of c2
.positiveExample
- Specify whether this example should be considered
a positive one.
java.lang.IllegalArgumentException
- if c1
or c2
is empty.Method Detail |
---|
public boolean areCoreferent()
public Mention getM1()
c1
if specified,
or null
if no first mention is available.public Mention getM2()
c2
if specified,
or null
if no second mention is available.public Mention getM(int n)
n
- if 1, return m1, if 2, return m2.
java.lang.IllegalArgumentException
- if n
is not 1 or 2.public java.util.Set<Mention> getC1()
m1
if no cluster has been specified.public java.util.Set<Mention> getC2()
m2
if no cluster has been specified.public Doc getDoc()
public void setPositive(boolean isPos)
areCoreferent()
method.
In the cluster case, it is recommended that isPos
be set to true if all pairs in the cross-product are coreferential,
and false if all such pairs are non-coreferential;
in case some pairs are coreferential,
the user may choose an intended interpretation.
(Note: The default definition of areCoreferent()
is subject to change).
isPos
- Specifies whether
this example should be considered positive.public boolean isPositive()
public java.lang.String toString()
>m1;<br>m2<
or if c1 or c2 are present, m1 or m2 is replaced with a comma separated
list of mentions.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |