de.fu_berlin.ties.filter
Class RepresentationFilter

java.lang.Object
  extended by de.fu_berlin.ties.filter.TrainableFilter
      extended by de.fu_berlin.ties.filter.RepresentationFilter
All Implemented Interfaces:
ElementFilter

public class RepresentationFilter
extends TrainableFilter

A trainable filter that uses a Representationto convert elements into feature vectors.

Version:
$Revision: 1.9 $, $Date: 2004/11/19 14:05:00 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
 
Fields inherited from class de.fu_berlin.ties.filter.TrainableFilter
BOOLEAN_CLASSES
 
Constructor Summary
RepresentationFilter(TiesConfiguration conf, NodeFilter positiveFilter, NodeFilter negativeFilter, Reranker rerank, Representation rep, String filterPurpose)
          Creates a new instance.
 
Method Summary
 FeatureVector buildFeatures(Element element)
          Converts an element into a feature vector to be used by the trainable classifier.
 void init(Document document)
          Resets the filter to start processing a new document. This method must be called for each document to be procesed by this filter prior to calling ElementFilter.matches(Element)or ElementFilter.prefers(Element)on elements of this document.
 boolean matches(Element element)
          Decides whether an element is accepted by this filter.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class de.fu_berlin.ties.filter.TrainableFilter
avoids, prefers, trainIfNecessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepresentationFilter

public RepresentationFilter(TiesConfiguration conf,
                            NodeFilter positiveFilter,
                            NodeFilter negativeFilter,
                            Reranker rerank,
                            Representation rep,
                            String filterPurpose)
                     throws ProcessingException
Creates a new instance.

Parameters:
conf - used to initialize the trainable classifier by calling TrainableClassifier.createClassifier( java.util.Set, TiesConfiguration)
positiveFilter - this filter is queried to decide whether this class prefersan element
negativeFilter - this filter is queried to decide whether this class avoidsan element
rerank - an optional reranker that recalculates probabilities to introduce a bias (can be used to favor recall over precision, by setting a bias > 1 for the "true" class, etc.); might be null
rep - the representation used to convert elements into feature vectors
filterPurpose - the purpose of this filter, e.g. "Sentence" if it is used for sentence filtering
Throws:
ProcessingException - if the initialization of the trainable classifier fails
Method Detail

buildFeatures

public FeatureVector buildFeatures(Element element)
Converts an element into a feature vector to be used by the trainable classifier.

Specified by:
buildFeatures in class TrainableFilter
Parameters:
element - the element to convert
Returns:
a feature vector representing the provided element

init

public void init(Document document)
Resets the filter to start processing a new document. This method must be called for each document to be procesed by this filter prior to calling ElementFilter.matches(Element)or ElementFilter.prefers(Element)on elements of this document.

Specified by:
init in interface ElementFilter
Overrides:
init in class TrainableFilter
Parameters:
document - the document to process

matches

public boolean matches(Element element)
                throws ProcessingException
Decides whether an element is accepted by this filter.

Specified by:
matches in interface ElementFilter
Overrides:
matches in class TrainableFilter
Parameters:
element - the element to test
Returns:
true if this filter accepts the element; false otherwise
Throws:
ProcessingException - if an error occurs during filtering

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class TrainableFilter
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.