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:
ReVerbRelationExtractor

public abstract class RelationFirstNpChunkExtractor
extends Extractor<ChunkedSentence,ChunkedBinaryExtraction>

Extracts ChunkedBinaryExtraction objects 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(Extractor), setArgument1Extractor(Extractor), and setArgument2Extractor(Extractor) methods.

Author:
afader

Field Summary
protected  boolean allowUnary
           
protected  Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr
           
protected  Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr
           
protected  Extractor<ChunkedSentence,ChunkedExtraction> relExtr
           
 
Constructor Summary
RelationFirstNpChunkExtractor()
           
 
Method Summary
protected  Collection<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 setAllowUnary(boolean allowUnary)
           
 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, getMappers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allowUnary

protected boolean allowUnary

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 -

setAllowUnary

public void setAllowUnary(boolean allowUnary)

extractCandidates

protected Collection<ChunkedBinaryExtraction> extractCandidates(ChunkedSentence source)
                                                         throws ExtractorException
Description copied from class: Extractor
Extracts candidate extractions from the given source object. When the user calls Extractor.extract(Object), the this method is used to generate a set of candidate extractions, which are then passed through each mapper object attached 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.
Throws:
ExtractorException - if unable to extract


Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.