edu.washington.cs.knowitall.extractor
Class RelationFirstNpChunkExtractor

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.Extractor<ChunkedSentence,ChunkedBinaryExtraction>
      extended by edu.washington.cs.knowitall.extractor.RelationFirstNpChunkExtractor
Direct Known Subclasses:
ReVerbExtractor

public abstract class RelationFirstNpChunkExtractor
extends Extractor<ChunkedSentence,ChunkedBinaryExtraction>

Extracts NpChunkedBinaryExtraction objects from an NpChunkedSentence source by first extracting relations, and then for each relation, extracting a pair of arguments. A RelationFirstNpChunkExtractor must have:

Subclasses extending RelationFirstNpChunkExtractor are responsible for setting the extractors via the setRelationExtractor, setArgument1Extractor, and setArgument2Extractor methods.

Author:
afader

Field Summary
protected  Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr
           
protected  Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr
           
protected  Extractor<ChunkedSentence,ChunkedExtraction> relExtr
           
 
Constructor Summary
RelationFirstNpChunkExtractor()
           
 
Method Summary
protected  java.lang.Iterable<ChunkedBinaryExtraction> extractCandidates(ChunkedSentence source)
          Extracts candidate extractions from the given source object.
 Extractor<ChunkedExtraction,ChunkedArgumentExtraction> getArgument1Extractor()
           
 Extractor<ChunkedExtraction,ChunkedArgumentExtraction> getArgument2Extractor()
           
 Extractor<ChunkedSentence,ChunkedExtraction> getRelationExtractor()
           
 void setArgument1Extractor(Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr)
          Sets the argument1 extractor.
 void setArgument2Extractor(Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr)
          Sets the argument2 extractor.
 void setRelationExtractor(Extractor<ChunkedSentence,ChunkedExtraction> relExtr)
          Sets the relation extractor.
 
Methods inherited from class edu.washington.cs.knowitall.extractor.Extractor
addMapper, compose, extract, extract, getMappers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relExtr

protected Extractor<ChunkedSentence,ChunkedExtraction> relExtr

arg1Extr

protected Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr

arg2Extr

protected Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr
Constructor Detail

RelationFirstNpChunkExtractor

public RelationFirstNpChunkExtractor()
Method Detail

getRelationExtractor

public Extractor<ChunkedSentence,ChunkedExtraction> getRelationExtractor()
Returns:
the extractor used to extract relations.

getArgument1Extractor

public Extractor<ChunkedExtraction,ChunkedArgumentExtraction> getArgument1Extractor()
Returns:
the extractor used to extract argument1.

getArgument2Extractor

public Extractor<ChunkedExtraction,ChunkedArgumentExtraction> getArgument2Extractor()
Returns:
the extractor used to extract argument2.

setRelationExtractor

public void setRelationExtractor(Extractor<ChunkedSentence,ChunkedExtraction> relExtr)
Sets the relation extractor.

Parameters:
relExtr -

setArgument1Extractor

public void setArgument1Extractor(Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr)
Sets the argument1 extractor.

Parameters:
arg1Extr -

setArgument2Extractor

public void setArgument2Extractor(Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr)
Sets the argument2 extractor.

Parameters:
arg2Extr -

extractCandidates

protected java.lang.Iterable<ChunkedBinaryExtraction> extractCandidates(ChunkedSentence source)
Description copied from class: Extractor
Extracts candidate extractions from the given source object. When the user calls the extract(S source) method, the extractCandidate(S source) method is used to generate a set of candidate extractions, which are then passed through each Mapper object assigned to the extractor.

Specified by:
extractCandidates in class Extractor<ChunkedSentence,ChunkedBinaryExtraction>
Parameters:
source - The source to extract from.
Returns:
An Iterable object over the candidate extractions.