edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors
Class CExampleExtractorBasic

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.ExampleExtractor<T>
      extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.BatchExExtractor<T>
          extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.FilteredBatchExExtractor<T>
              extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.DocFilteredBatchExEx<CExample>
                  extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.CExampleExtractorBasic
All Implemented Interfaces:
CExampleExtractor, DocExampleExtractor<CExample>, java.io.Serializable, LBJ2.parse.Parser
Direct Known Subclasses:
CExExClosestPosAllNeg, CExExtractorUntilTrue

public class CExampleExtractorBasic
extends DocFilteredBatchExEx<CExample>
implements CExampleExtractor, java.io.Serializable

Extracts coreference examples from a document from all ordered pairs of mentions of a document such that any filters accept them. If a document is not provided in the constructor, it must be set first using setDoc().

Author:
Eric Bengtson
See Also:
Serialized Form

Field Summary
private  boolean m_bBothMentions
           
private  CFilter m_cFilter
           
private  MFilter m_m2Filter
           
private  MFilter m_mFilter
           
private static long serialVersionUID
           
 
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.DocFilteredBatchExEx
m_doc
 
Constructor Summary
CExampleExtractorBasic()
          Constructs a coreference example extractor with the default settings.
CExampleExtractorBasic(CFilter cFilter)
          Constructs a coreference example extractor with a CExample filter.
CExampleExtractorBasic(CFilter cFilter, MFilter mFilter, boolean bBothMentions)
          Constructs a coreference example extractor with a CExample filter and a Mention filter.
CExampleExtractorBasic(CFilter cFilter, MFilter m1Filter, MFilter m2Filter)
          Constructs a coreference example extractor with a CExample filter and two Mention filters.
CExampleExtractorBasic(Doc doc)
          Constructs a coreference example extractor that will extract examples from the given document.
CExampleExtractorBasic(Doc doc, CFilter cFilter)
          Constructs a coreference example extractor with a CExample filter that will extract examples from the given document.
 
Method Summary
 boolean doFiltersAccept(CExample ex)
          Determines whether all applicable filters accept the example.
protected  java.util.List<CExample> generateAllExamples()
          Generates coreference examples from all ordered pairs of mentions of a document such that any filters accept them.
protected  CExample getExample(Doc d, int iM1, int iM2)
          Get a specific example.
protected  void setCFilter(CFilter cFilter)
          Sets the coreference filter.
protected  void setMFilter(MFilter mFilter)
          Sets the mention filter.
protected  void setMFilters(MFilter m1Filter, MFilter m2Filter)
          Sets both filters, and specify that each must accept its mention for an example to be accepted.
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.DocFilteredBatchExEx
getDoc, setDoc
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.FilteredBatchExExtractor
getExamples, getFilterAccepted
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.BatchExExtractor
getNextCached, next, recordEquivalence, reset
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.ExampleExtractor
close, enqueue
 
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.exampleExtractors.DocExampleExtractor
getDoc, getExamples, next, recordEquivalence, reset, setDoc
 
Methods inherited from interface LBJ2.parse.Parser
close
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

m_cFilter

private CFilter m_cFilter

m_bBothMentions

private boolean m_bBothMentions

m_mFilter

private MFilter m_mFilter

m_m2Filter

private MFilter m_m2Filter
Constructor Detail

CExampleExtractorBasic

public CExampleExtractorBasic()
Constructs a coreference example extractor with the default settings.


CExampleExtractorBasic

public CExampleExtractorBasic(CFilter cFilter)
Constructs a coreference example extractor with a CExample filter.

Parameters:
cFilter - A coreference example filter.

CExampleExtractorBasic

public CExampleExtractorBasic(CFilter cFilter,
                              MFilter mFilter,
                              boolean bBothMentions)
Constructs a coreference example extractor with a CExample filter and a Mention filter.

Parameters:
cFilter - A coreference example filter.
mFilter - A mention filter.
bBothMentions - Determines whether both mentions in an example must be accepted by the filter for the example to be accepted.

CExampleExtractorBasic

public CExampleExtractorBasic(CFilter cFilter,
                              MFilter m1Filter,
                              MFilter m2Filter)
Constructs a coreference example extractor with a CExample filter and two Mention filters. The order of the mention filters is significant.

Parameters:
cFilter - A coreference example filter.
m1Filter - A mention filter for the first mention of a CExample.
m2Filter - A mention filter for the second mention of a CExample.

CExampleExtractorBasic

public CExampleExtractorBasic(Doc doc)
Constructs a coreference example extractor that will extract examples from the given document.

Parameters:
doc - The document whose examples will be extracted.

CExampleExtractorBasic

public CExampleExtractorBasic(Doc doc,
                              CFilter cFilter)
Constructs a coreference example extractor with a CExample filter that will extract examples from the given document.

Parameters:
cFilter - A coreference example filter.
doc - The document whose examples will be extracted.
Method Detail

generateAllExamples

protected java.util.List<CExample> generateAllExamples()
Generates coreference examples from all ordered pairs of mentions of a document such that any filters accept them. Uses predicted or true mentions according to the output of the document's getMentions() method.

Specified by:
generateAllExamples in class BatchExExtractor<CExample>
Returns:
A list of examples.

setCFilter

protected void setCFilter(CFilter cFilter)
Sets the coreference filter. Since examples are extracted in a batch, filters should be set before doc is set.

Parameters:
cFilter - The CExample filter.

setMFilter

protected void setMFilter(MFilter mFilter)
Sets the mention filter. Since examples are extracted in a batch, filters should be set before doc is set.

Parameters:
mFilter - The filter.

setMFilters

protected void setMFilters(MFilter m1Filter,
                           MFilter m2Filter)
Sets both filters, and specify that each must accept its mention for an example to be accepted. Since examples are extracted in a batch, filters should be set before doc is set.

Parameters:
m1Filter - The first filter.
m2Filter - The second filter.

doFiltersAccept

public boolean doFiltersAccept(CExample ex)
Determines whether all applicable filters accept the example.

Overrides:
doFiltersAccept in class DocFilteredBatchExEx<CExample>
Parameters:
ex - The example.
Returns:
Whether the filters accept the example.

getExample

protected CExample getExample(Doc d,
                              int iM1,
                              int iM2)
Get a specific example.

Returns:
relevant example using mention numbering based on the document's getMentions().