cc.mallet.grmm.learning.extract
Class ACRFExtractor

java.lang.Object
  extended by cc.mallet.grmm.learning.extract.ACRFExtractor
All Implemented Interfaces:
Extractor, java.io.Serializable

public class ACRFExtractor
extends java.lang.Object
implements Extractor

Created: Mar 1, 2005

Version:
$Id: ACRFExtractor.java,v 1.1 2007/10/22 21:38:02 mccallum Exp $
Author:
Serialized Form

Constructor Summary
ACRFExtractor(ACRF acrf, Pipe tokPipe, Pipe featurePipe)
           
 
Method Summary
 Extraction extract(InstanceList testing)
           
 Extraction extract(java.util.Iterator<Instance> source)
          Performs extraction on a a set of raw documents.
 Extraction extract(java.lang.Object o)
          Performs extraction given a raw object.
 Extraction extract(Tokenization toks)
          Performs extraction from an object that has been already been tokenized.
 ACRF getAcrf()
           
 Pipe getFeaturePipe()
          Returns the pipe used by this extractor for.
 Alphabet getInputAlphabet()
          Returns an alphabet of the features used by the extractor.
 LabelAlphabet getTargetAlphabet()
          Returns an alphabet of the labels used by the extractor.
 Pipe getTokenizationPipe()
          Returns the pipe used by this extractor to tokenize the input.
 void setSlice(int sl)
           
 void setTokenizationFilter(TokenizationFilter filter)
           
 void setTokenizationPipe(Pipe pipe)
          Sets the pipe used by this extractor for tokenization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACRFExtractor

public ACRFExtractor(ACRF acrf,
                     Pipe tokPipe,
                     Pipe featurePipe)
Method Detail

extract

public Extraction extract(java.lang.Object o)
Description copied from interface: Extractor
Performs extraction given a raw object. The object will be passed through the Extractor's pipe.

Specified by:
extract in interface Extractor
Parameters:
o - The document to extract from (often a String).
Returns:
Extraction the results of performing extraction

extract

public Extraction extract(Tokenization toks)
Description copied from interface: Extractor
Performs extraction from an object that has been already been tokenized. This method will pass spans through the extractor's pipe.

Specified by:
extract in interface Extractor
Parameters:
toks - A tokenized document
Returns:
Extraction the results of performing extraction

extract

public Extraction extract(java.util.Iterator<Instance> source)
Description copied from interface: Extractor
Performs extraction on a a set of raw documents. The Instances output from source will be passed through both the tokentization pipe and the feature extraction pipe.

Specified by:
extract in interface Extractor
Parameters:
source - A source of raw documents
Returns:
Extraction the results of performing extraction

extract

public Extraction extract(InstanceList testing)

getFeaturePipe

public Pipe getFeaturePipe()
Description copied from interface: Extractor
Returns the pipe used by this extractor for. The pipe takes an Instance and converts it into a form usable by the particular extraction algorithm. This pipe expects the Instance's data field to be a Tokenization. For example, pipes often perform feature extraction. The type of raw object expected by the pipe depends on the particular subclass of extractor.

Specified by:
getFeaturePipe in interface Extractor
Returns:
a pipe

getTokenizationPipe

public Pipe getTokenizationPipe()
Description copied from interface: Extractor
Returns the pipe used by this extractor to tokenize the input. The type of Instance of this pipe expects is specific to the individual extractor. This pipe will return an Instance whose data is a Tokenization.

Specified by:
getTokenizationPipe in interface Extractor
Returns:
a pipe

setTokenizationPipe

public void setTokenizationPipe(Pipe pipe)
Description copied from interface: Extractor
Sets the pipe used by this extractor for tokenization. The pipe should takes a raw object and convert it into a Tokenization.

The pipe @link{edu.umass.cs.mallet.base.pipe.CharSequence2TokenSequence} is an example of a pipe that could be used here.

Specified by:
setTokenizationPipe in interface Extractor

getInputAlphabet

public Alphabet getInputAlphabet()
Description copied from interface: Extractor
Returns an alphabet of the features used by the extractor. The alphabet maps strings describing the features to indices.

Specified by:
getInputAlphabet in interface Extractor
Returns:
the input alphabet

getTargetAlphabet

public LabelAlphabet getTargetAlphabet()
Description copied from interface: Extractor
Returns an alphabet of the labels used by the extractor. Labels include entity types (such as PERSON) and slot names (such as EMPLOYEE-OF).

Specified by:
getTargetAlphabet in interface Extractor
Returns:
the target alphabet

getAcrf

public ACRF getAcrf()

setSlice

public void setSlice(int sl)

setTokenizationFilter

public void setTokenizationFilter(TokenizationFilter filter)