|
||||||||||
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.decoders.DecoderWithOptions<ST> edu.illinois.cs.cogcomp.lbj.coref.decoders.ChainSolutionDecoder<ChainSolution<Mention>,Mention,CExample> edu.illinois.cs.cogcomp.lbj.coref.decoders.CorefDecoder edu.illinois.cs.cogcomp.lbj.coref.decoders.ScoredCorefDecoder edu.illinois.cs.cogcomp.lbj.coref.decoders.BestLinkDecoder
public class BestLinkDecoder
Translates classification decisions to a collection of
coreference equivalence classes
in the form of a ChainSolution
via the decode method according to the
best link decoding algorithm.
The best link decoding method specifies that for each mention m
a link will be produced with highest scoring preceding mention a
only if ScoredCorefDecoder.predictedCoreferential(CExample)
returns true for the example doc.getCExampleFor(a, m)
.
Also, allows several options to be set that modify the performance
of the best link decoding algorithm.
See the relevant setter methods for details.
Field Summary | |
---|---|
protected boolean |
m_allowCataphora
Whether to allow cataphora. |
protected boolean |
m_experimental
Currently does nothing. |
protected boolean |
m_preventLongDistPRO
Whether to prevent long distance pronoun reference. |
protected java.io.PrintStream |
m_scoresLog
Holds the optional scores log. |
private static long |
serialVersionUID
|
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.ScoredCorefDecoder |
---|
m_cacheScores, m_recordAllScores, m_scorer |
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.CorefDecoder |
---|
m_classifier |
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions |
---|
m_options, m_train |
Constructor Summary | |
---|---|
BestLinkDecoder(LBJ2.learn.LinearThresholdUnit scorer)
Constructor for the case where a scoring classifier has had its threshold set. |
|
BestLinkDecoder(LBJ2.learn.LinearThresholdUnit scorer,
LBJ2.classify.Classifier decider)
Constructor for use when the scoring classifier is not sufficient to decide whether links should be made, such as when inference is being applied. |
Method Summary | |
---|---|
ChainSolution<Mention> |
decode(Doc doc)
Takes the mentions in the specified document and produces a collection of coreference equivalence classes. |
java.lang.String |
getStatsString()
Enables recorded statistics to be returned. |
void |
processOption(java.lang.String option,
java.lang.String value)
Processes the options by calling super and calling the dedicated methods for setting specific options. |
protected void |
recordStatsFor(CExample ex)
Enables the recording of data about coreference examples as they are used in the decoding algorithm. |
void |
setAllowPronounCataphora(boolean allow)
Specifies whether to allow pronoun cataphora Specifically, if allow is true, a pronoun
cannot take an referent that appears after the pronoun. |
void |
setPreventLongDistPRO(boolean prevent)
Specifies whether to limit pronoun reference to within a small number of sentences. |
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.ScoredCorefDecoder |
---|
getEdgeLabels, getFeatureWeights, getMinimumPartsOfCompounds, getScorer, getSumsOfParts, getTotalsOfPartsOfCompounds, getTrueScore, predictedCoreferential, setScorer, setup |
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.CorefDecoder |
---|
getClassifier, setClassifier |
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions |
---|
getBooleanOption, getOption, getRealOption, setOption, setOption, setOption, setTrain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected boolean m_allowCataphora
protected boolean m_preventLongDistPRO
protected boolean m_experimental
protected java.io.PrintStream m_scoresLog
Constructor Detail |
---|
public BestLinkDecoder(LBJ2.learn.LinearThresholdUnit scorer)
scorer
- A scoring classifier
(specifically, a LinearThresholdUnit
),
whose threshold should be set using its setThreshold
method.
scorer
's discreteValue
takes CExample
s
and returns "true" or "false".
It also provides scores for the "true" value.public BestLinkDecoder(LBJ2.learn.LinearThresholdUnit scorer, LBJ2.classify.Classifier decider)
scorer
and decider
must return "true" for an
example to be considered coreferential.
scorer
- Determines the score or confidence.
Takes CExample
s and returns a score.decider
- Final arbiter of linking decisions.
Takes CExample
s and returns "true" or "false".Method Detail |
---|
public ChainSolution<Mention> decode(Doc doc)
m
a link will be produced with highest scoring preceding mention a
only if ScoredCorefDecoder.predictedCoreferential(CExample)
returns true for the example doc.getCExampleFor(a, m)
.
Note: Several options ignore
the ScoredCorefDecoder.predictedCoreferential(CExample)
method;
in these cases, a decider may specify false and links may still be made,
possibly interfering with successful inference.
decode
in interface SolutionDecoder<ChainSolution<Mention>>
decode
in class ChainSolutionDecoder<ChainSolution<Mention>,Mention,CExample>
doc
- a document whose mentions will be placed in coreference
classes.
ChainSolution
representing the coreference equivalence
classes as chains. Links established between mentions will also
be given labels in the solution.public void setAllowPronounCataphora(boolean allow)
allow
is true, a pronoun
cannot take an referent that appears after the pronoun.
allow
- Whether to allow a pronoun to refer to mentions
appearing after the pronoun.public void setPreventLongDistPRO(boolean prevent)
prevent
is true, a pronoun
cannot take an antecedent from any sentence earlier than the
previous sentence.
prevent
- Whether to prevent long-distance pronoun reference.public void processOption(java.lang.String option, java.lang.String value)
m_scoresLog
print stream.
processOption
in class DecoderWithOptions<ChainSolution<Mention>>
option
- The name of the option, which is generally
all lowercase.value
- The value, which may be the string representation
of a boolean or real value
(In a format supported by by Boolean.parseBoolean(java.lang.String)
or Double.parseDouble(java.lang.String)
)
or any arbitrary string.protected void recordStatsFor(CExample ex)
ex
- The example whose statistics should be recorded.public java.lang.String getStatsString()
getStatsString
in class ScoredCorefDecoder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |