edu.washington.cs.knowitall.extractor.mapper
Class ReVerbRelationDictionaryFilter

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.mapper.Mapper<T>
      extended by edu.washington.cs.knowitall.extractor.mapper.FilterMapper<ChunkedExtraction>
          extended by edu.washington.cs.knowitall.extractor.mapper.ReVerbRelationDictionaryFilter

public class ReVerbRelationDictionaryFilter
extends FilterMapper<ChunkedExtraction>

Filters relations based on how many distinct arg2 values it takes in a large corpus. These frequencies must be pre-computed and stored in a flat file in the tab-delimited format (#arg2s, relation). The relations should be normalized using the VerbalRelationNormalizer class. By default, this class searches the classpath for a file called freq_rel.txt.gz and reads the relations with at least 20 distinct arg2s from it.

Author:
afader

Constructor Summary
ReVerbRelationDictionaryFilter()
          Constructs a new dictionary filter using the data in the file freq_rel.txt.gz, and loads all relations with at least 20 distinct arg2s.
ReVerbRelationDictionaryFilter(java.io.InputStream in, int minFreq)
          Constructs a new dictionary filter from the data in in.
ReVerbRelationDictionaryFilter(int minFreq)
          Constructs a new dictionary filter using the data in the file freq_rel.txt.gz, which is found on the classpath.
 
Method Summary
 boolean doFilter(ChunkedExtraction extr)
           
 
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.FilterMapper
doMap
 
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.Mapper
disable, enable, isEnabled, map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReVerbRelationDictionaryFilter

public ReVerbRelationDictionaryFilter(java.io.InputStream in,
                                      int minFreq)
                               throws java.io.IOException
Constructs a new dictionary filter from the data in in. This data should be in the tab-delimited format (#arg2, relation).

Parameters:
in - the dictionary of relations and their number of distinct arg2s.
minFreq - the minimum number of distinct arg2s a relation must have to be included.
Throws:
java.io.IOException

ReVerbRelationDictionaryFilter

public ReVerbRelationDictionaryFilter(int minFreq)
                               throws java.io.IOException
Constructs a new dictionary filter using the data in the file freq_rel.txt.gz, which is found on the classpath.

Parameters:
minFreq - the minimum number of distinct arg2s a relation must have to be included.
Throws:
java.io.IOException

ReVerbRelationDictionaryFilter

public ReVerbRelationDictionaryFilter()
                               throws java.io.IOException
Constructs a new dictionary filter using the data in the file freq_rel.txt.gz, and loads all relations with at least 20 distinct arg2s.

Throws:
java.io.IOException
Method Detail

doFilter

public boolean doFilter(ChunkedExtraction extr)
Specified by:
doFilter in class FilterMapper<ChunkedExtraction>