edu.washington.cs.knowitall.extractor
Class RelationFirstNpChunkExtractor
java.lang.Object
edu.washington.cs.knowitall.extractor.Extractor<ChunkedSentence,ChunkedBinaryExtraction>
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:
- A relation extractor of type
Extractor
- An argument1 extractor of type
Extractor
- An argument2 extractor of type
Extractor
Subclasses extending RelationFirstNpChunkExtractor
are responsible for setting the extractors via
the setRelationExtractor
, setArgument1Extractor
, and setArgument2Extractor
methods.
- Author:
- afader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
relExtr
protected Extractor<ChunkedSentence,ChunkedExtraction> relExtr
arg1Extr
protected Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg1Extr
arg2Extr
protected Extractor<ChunkedExtraction,ChunkedArgumentExtraction> arg2Extr
RelationFirstNpChunkExtractor
public RelationFirstNpChunkExtractor()
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.