uk.ac.gla.dcs.renaissance.iqir.query
Class RFOperator

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.query.RFOperator
All Implemented Interfaces:
Operator

public class RFOperator
extends Object
implements Operator

An operator based on relevance feedback data. It creates a ranking, based on the given scorer function, w.r.t. the given query. From the top k documents it extracts the IN vectors and creates a density out of it.

Author:
Ingo Frommholz

Constructor Summary
RFOperator(String scorer, String query, int k)
           
 
Method Summary
 void addINSamplingQueries(Set<String> set)
          Add the queries that will be used to compute base densities.
 void addTerms(Set<String> set)
          Add the terms
 void applyToSuboperators(OperatorTransformer transformer)
          Apply the transformation to all sub-operators
 WeightedVectorSet compute(boolean needsSum, bpiwowar.log.TaskTimer timer)
          Computes the density.
 Operator copy()
          Deep copy of this operator
 Iterable<Operator> getSubOperators()
          Get all the suboperators (used to process recursively all the nodes of a query).
 void init(Informations informations)
          Initialise this operator so as to prepare computation
 boolean isNull()
          Returns true if the density is null (e.g., stopped term).
 Operator simplify()
          Simplify this operator (calls simplify recursively).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFOperator

public RFOperator(String scorer,
                  String query,
                  int k)
Parameters:
scorer - the scorer to use, e.g. "BM25"
query - the query in a format understood by the scorer
k - take the top k documents for relevance feedback
Method Detail

init

public void init(Informations informations)
Description copied from interface: Operator
Initialise this operator so as to prepare computation

Specified by:
init in interface Operator

addINSamplingQueries

public void addINSamplingQueries(Set<String> set)
Description copied from interface: Operator
Add the queries that will be used to compute base densities. The syntax of the queries can be found in in the MG4J API.

Specified by:
addINSamplingQueries in interface Operator
Parameters:
set - The base queries should be added to this set

compute

public WeightedVectorSet compute(boolean needsSum,
                                 bpiwowar.log.TaskTimer timer)
                          throws Throwable
Description copied from interface: Operator
Computes the density. The object will be first initialised with Operator.init(Informations)

Specified by:
compute in interface Operator
Parameters:
needsSum - If the sum of vectors is needed
timer - A timer to give information about the task progress
Returns:
A density with the sum
Throws:
Throwable - if something goes wrong

isNull

public boolean isNull()
Description copied from interface: Operator
Returns true if the density is null (e.g., stopped term). The object should have been initialised before with Operator.init(Informations)

Specified by:
isNull in interface Operator

simplify

public Operator simplify()
Description copied from interface: Operator
Simplify this operator (calls simplify recursively). The object should be initialised with Operator.init(Informations)

Specified by:
simplify in interface Operator

addTerms

public void addTerms(Set<String> set)
Description copied from interface: Operator
Add the terms

Specified by:
addTerms in interface Operator
Parameters:
set - The set of terms

getSubOperators

public Iterable<Operator> getSubOperators()
Description copied from interface: Operator
Get all the suboperators (used to process recursively all the nodes of a query). No special order is expected between nodes.

Specified by:
getSubOperators in interface Operator

copy

public Operator copy()
Description copied from interface: Operator
Deep copy of this operator

Specified by:
copy in interface Operator

applyToSuboperators

public void applyToSuboperators(OperatorTransformer transformer)
Description copied from interface: Operator
Apply the transformation to all sub-operators

Specified by:
applyToSuboperators in interface Operator


Copyright © 2011. All Rights Reserved.