org.terrier.querying
Class ExpansionTerms

java.lang.Object
  extended by org.terrier.querying.ExpansionTerms
Direct Known Subclasses:
DFRBagExpansionTerms

public abstract class ExpansionTerms
extends java.lang.Object

Base class for weighting term occurrences in feedback documents.

Since:
3.0
Author:
Craig Macdonald

Nested Class Summary
static class ExpansionTerms.ExpansionTerm
          This class implements a data structure for a term in the top-retrieved documents.
 
Field Summary
protected static java.util.Comparator<ExpansionTerms.ExpansionTerm> EXPANSIONTERM_DESC_SCORE_SORTER
           
protected static org.apache.log4j.Logger logger
           
protected  QueryExpansionModel model
           
protected  gnu.trove.TIntDoubleHashMap originalTermFreqs
          The frequency of each query term in the original query.
protected  gnu.trove.TIntObjectHashMap<java.lang.String> originalTermids
          The original query terms.
 
Constructor Summary
protected ExpansionTerms()
           
 
Method Summary
abstract  SingleTermQuery[] getExpandedTerms(int numberOfExpandedTerms)
          Get the most informative terms for the expanded set.
abstract  int getNumberOfUniqueTerms()
          Returns the number of terms being considered
abstract  void insertDocument(FeedbackDocument doc)
          Add a single document to be considered for expanding the query
 void setModel(QueryExpansionModel m)
          Set query expansion model
 void setOriginalQueryTerms(MatchingQueryTerms query)
          Set the original query terms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

EXPANSIONTERM_DESC_SCORE_SORTER

protected static final java.util.Comparator<ExpansionTerms.ExpansionTerm> EXPANSIONTERM_DESC_SCORE_SORTER

originalTermids

protected gnu.trove.TIntObjectHashMap<java.lang.String> originalTermids
The original query terms. Used only for Conservative Query Expansion, where no terms are added to the query, only the existing ones are reweighted.


originalTermFreqs

protected gnu.trove.TIntDoubleHashMap originalTermFreqs
The frequency of each query term in the original query. Currently used by RM3 only.


model

protected QueryExpansionModel model
Constructor Detail

ExpansionTerms

protected ExpansionTerms()
Method Detail

setOriginalQueryTerms

public void setOriginalQueryTerms(MatchingQueryTerms query)
Set the original query terms.

Parameters:
query - The original query.

insertDocument

public abstract void insertDocument(FeedbackDocument doc)
                             throws java.io.IOException
Add a single document to be considered for expanding the query

Throws:
java.io.IOException

getExpandedTerms

public abstract SingleTermQuery[] getExpandedTerms(int numberOfExpandedTerms)
Get the most informative terms for the expanded set.

Parameters:
numberOfExpandedTerms - - number of terms to get.
Returns:
weighted query terms

setModel

public void setModel(QueryExpansionModel m)
Set query expansion model

Parameters:
m -

getNumberOfUniqueTerms

public abstract int getNumberOfUniqueTerms()
Returns the number of terms being considered



Terrier 3.5. Copyright © 2004-2011 University of Glasgow