|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.filter.TrainableFilter
de.fu_berlin.ties.filter.RepresentationFilter
public class RepresentationFilter
A trainable filter that uses a
Representation
to convert elements into
feature vectors.
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,
File filename)
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 |
---|
public RepresentationFilter(TiesConfiguration conf, NodeFilter positiveFilter, NodeFilter negativeFilter, Reranker rerank, Representation rep, String filterPurpose) throws ProcessingException
conf
- used to initialize the trainable classifier by calling TrainableClassifier.createClassifier(
java.util.Set, TiesConfiguration, String)
with an optional "filter"
suffixpositiveFilter
- this filter is queried to decide whether this class
prefers
an elementnegativeFilter
- this filter is queried to decide whether this class
avoids
an elementrerank
- 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
vectorsfilterPurpose
- the purpose of this filter, e.g. "Sentence" if it is
used for sentence filtering
ProcessingException
- if the initialization of the trainable
classifier failsMethod Detail |
---|
public FeatureVector buildFeatures(Element element)
buildFeatures
in class TrainableFilter
element
- the element to convert
public void init(Document document, File filename) throws ProcessingException, IOException
ElementFilter.matches(Element)
or ElementFilter.prefers(Element)
on elements of
this document.
init
in interface ElementFilter
init
in class TrainableFilter
document
- the document to processfilename
- the file name of the document
ProcessingException
- if an error occurs while starting to
process the document
IOException
- if an I/O error occurspublic boolean matches(Element element) throws ProcessingException
matches
in interface ElementFilter
matches
in class TrainableFilter
element
- the element to test
true
if this filter accepts the element;
false
otherwise
ProcessingException
- if an error occurs during filteringpublic String toString()
toString
in class TrainableFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |