|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions<ChainSolution<CT>>
edu.illinois.cs.cogcomp.lbj.coref.decoders.KeyChainDecoder<Mention>
edu.illinois.cs.cogcomp.lbj.coref.decoders.CorefKeyDecoder
public class CorefKeyDecoder
A decoder that extracts the true entities of a document and encodes
them in a ChainSolution
.
Provides facility for filtering some of those mentions.
Field Summary | |
---|---|
private boolean |
m_allMents
Whether all predicted mentions should be added to the solution. |
private boolean |
m_bBothMustAccept
Whether a pair of mentions must both be accepted to link them. |
private MFilter |
m_m2Filter
This filter should be m_mFilter if only one filter needed. |
private MFilter |
m_mFilter
The first filter, which may be null if no filtering is desired. |
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions |
---|
m_options, m_train |
Constructor Summary | |
---|---|
CorefKeyDecoder()
Construct a decoder that does not filter but adds all predicted mentions to the resulting solution. |
|
CorefKeyDecoder(MFilter filter)
Constructor that accepts a single mention filter and requires that a pair of mentions both be accepted for the pair to be linked in the solution. |
|
CorefKeyDecoder(MFilter filter,
boolean bothMustAccept)
Constructor that accepts a single mention filter |
|
CorefKeyDecoder(MFilter filter,
boolean bothMustAccept,
boolean allMents)
Constructor that accepts a single mention filter |
|
CorefKeyDecoder(MFilter m1Filter,
MFilter m2Filter)
Constructs a decoder that accepts two filters. |
|
CorefKeyDecoder(MFilter m1Filter,
MFilter m2Filter,
boolean allMents)
Constructs a decoder that accepts two filters. |
Method Summary | |
---|---|
ChainSolution<Mention> |
decode(Doc doc)
Extract the entities from a document and encode the parts that are accepted by any optional filters into a ChainSolution
representing those entities. |
private boolean |
doAccept(Mention m1,
Mention m2)
Determine whether filter(s) accept the mentions. |
protected void |
oneFilterEntity(ChainSolution<Mention> sol,
Entity ent)
Adds the mentions of the provided entity that are accepted by the (first) filter as a chain in the solution. |
protected void |
twoFilterEntity(ChainSolution<Mention> sol,
Entity ent)
Links every pair of mentions of the provided entity that are accepted by the filter(s). |
protected void |
zeroFilterEntity(ChainSolution<Mention> sol,
Entity ent)
Adds the mentions in the provided entity as a chain in the solution. |
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.decoders.DecoderWithOptions |
---|
getBooleanOption, getOption, getRealOption, processOption, setOption, setOption, setOption, setTrain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.illinois.cs.cogcomp.lbj.coref.decoders.SolutionDecoder |
---|
setOption |
Field Detail |
---|
private MFilter m_mFilter
private MFilter m_m2Filter
private boolean m_bBothMustAccept
private boolean m_allMents
Constructor Detail |
---|
public CorefKeyDecoder()
public CorefKeyDecoder(MFilter filter)
filter
- The mention filter.public CorefKeyDecoder(MFilter filter, boolean bothMustAccept)
filter
- A mention filter.bothMustAccept
- If true, a pair of mentions in a entity must both
be accepted by the filter for the pair to be linked,
otherwise, any pair where at least one mention is accepted
by the filter will be linked.public CorefKeyDecoder(MFilter filter, boolean bothMustAccept, boolean allMents)
filter
- A mention filter.bothMustAccept
- If true, a pair of mentions in a entity must both
be accepted by the filter for the pair to be linked,
otherwise, any pair where at least one mention is accepted
by the filter will be linked.allMents
- Whether to add all predicted mentions to the solution.public CorefKeyDecoder(MFilter m1Filter, MFilter m2Filter, boolean allMents)
m1Filter
- One filter, which should not be null
.m2Filter
- Another filter, which should not be null
.allMents
- Whether to add all predicted mentions to the solution.public CorefKeyDecoder(MFilter m1Filter, MFilter m2Filter)
m1Filter
- One filter, which should not be null
.m2Filter
- Another filter, which should not be null
.Method Detail |
---|
public ChainSolution<Mention> decode(Doc doc)
ChainSolution
representing those entities.
decode
in interface KeyDecoder<ChainSolution<Mention>>
decode
in interface SolutionDecoder<ChainSolution<Mention>>
decode
in class KeyChainDecoder<Mention>
doc
- The document whose entities to extract.
ChainSolution
representing entities
as chains of mentions.protected void zeroFilterEntity(ChainSolution<Mention> sol, Entity ent)
sol
- The solution, to be modified in place.ent
- The entity whose mentions should be placed in a chain.protected void oneFilterEntity(ChainSolution<Mention> sol, Entity ent)
sol
- The solution, to be modified in place.ent
- The entity whose mentions should be placed in a chain.protected void twoFilterEntity(ChainSolution<Mention> sol, Entity ent)
sol
- The solution, to be modified in place.ent
- The entity whose mentions should be linked.private boolean doAccept(Mention m1, Mention m2)
m1
- One mention.m2
- Another mention.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |