|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.applications.TRECQuerying
public class TRECQuerying
This class performs a batch mode retrieval from a set of TREC queries.
In the following, we list the main ways for configuring TRECQuerying, before exhaustively listing the properties that can affect TRECQuerying.
<top> <num> Number 1 </num> <title> Query terms </title> <desc> Description : A setence about the information need </desc> <narr> Narrative: More sentences about what is relevant or not</narr> </top>If you have a topic files in a different format, you can used a differed QuerySource by setting the property trec.topics.parser. For instance trec.topics.parser=SingleLineTRECQuery should be used for topics where one line is one query. See
TRECQuery
and SingleLineTRECQuery
for more information.
InL2
retrieval model for all runs.
If the trec.model property is specified, then all runs will be made
using that weighting model. You can change this by specifying another
model using the property trec.model. E.g., to use
PL2
, set trec.model=PL2.
Similarly, when query expansion is enabled, the
default query expansion model is Bo1
, controlled by the property
trec.qe.model.
Nested Class Summary | |
---|---|
static class |
TRECQuerying.NullOutputFormat
An OutputFormat instance which does nothing. |
static interface |
TRECQuerying.OutputFormat
interface for adjusting the output of TRECQuerying |
static interface |
TRECQuerying.QueryResultCache
Interface for introducing caching strategies into TRECQuerying |
static interface |
TRECQuerying.QuerySource
This interface denotes a source of queries for batch evaluation |
static class |
TRECQuerying.TRECDocidOutputFormat
OutputFormat for writing TREC runs where the docnos are NOT looked up, but instead the (integer, internal) docids are recorded in the .res file. |
static class |
TRECQuerying.TRECDocnoOutputFormat
Standard OutputFormat for writing TREC runs |
Field Summary | |
---|---|
protected java.lang.String |
defaultQEModel
The name of the query expansion model used. |
protected static boolean |
DUMP_SETTINGS
Dump the current settings along with the results. |
protected Index |
index
The object that encapsulates the data structures used by Terrier. |
protected static org.apache.log4j.Logger |
logger
The logger used |
protected java.lang.String |
managerName
The name of the manager object that handles the queries. |
protected int |
matchingCount
The number of matched queries. |
protected java.lang.String |
method
The method - ie the weighting model and parameters. |
protected java.lang.String |
mModel
The name of the matching model that is used for retrieval. |
protected TRECQuerying.OutputFormat |
printer
Where results of the stream of queries are output to. |
protected boolean |
queryexpansion
the boolean indicates whether to expand queries |
protected Manager |
queryingManager
The manager object that handles the queries. |
protected TRECQuerying.QuerySource |
querySource
Where the stream of queries is obtained from. |
protected static java.util.Random |
random
random number generator |
protected static boolean |
removeQueryPeriods
|
protected java.io.PrintWriter |
resultFile
The file to store the output to. |
protected TRECQuerying.QueryResultCache |
resultsCache
results are obtained a query cache is one is enabled. |
protected java.lang.String |
resultsFilename
The filename of the last file results were output to. |
protected java.lang.String |
topicsParser
What class parse to parse the batch topic files. |
protected java.lang.String |
wModel
The name of the weighting model that is used for retrieval. |
Constructor Summary | |
---|---|
TRECQuerying()
TRECQuerying default constructor initialises the inverted index, the lexicon and the document index structures. |
|
TRECQuerying(boolean _queryexpansion)
TRECQuerying constructor initialises the inverted index, the lexicon and the document index structures. |
|
TRECQuerying(Index i)
TRECQuerying constructor initialises the specified inverted index, the lexicon and the document index structures. |
Method Summary | |
---|---|
void |
close()
Closes the used structures. |
protected void |
createManager()
Create a querying manager. |
protected void |
finishedQueries()
After finishing with a batch of queries, close the result file |
Index |
getIndex()
Get the index pointer. |
Manager |
getManager()
Get the querying manager. |
protected java.lang.String |
getNextQueryCounter(java.lang.String resultsFolder)
Get the sequential number of the next result file in the results folder. |
protected TRECQuerying.OutputFormat |
getOutputFormat()
|
protected TRECQuerying.QuerySource |
getQueryParser()
Get the query parser that is being used. |
protected java.lang.String |
getRandomQueryCounter()
Get a random number between 0 and 1000. |
java.io.PrintWriter |
getResultFile(java.lang.String predefinedName)
Returns a PrintWriter used to store the results. |
protected TRECQuerying.QueryResultCache |
getResultsCache()
Obtain the query cache. |
protected java.lang.String |
getSequentialQueryCounter(java.lang.String resultsFolder)
Get the sequential number of the current result file in the results folder. |
protected void |
initSearchRequestModification(java.lang.String queryId,
SearchRequest srq)
|
protected void |
loadIndex()
Loads index(s) from disk. |
protected void |
preQueryingSearchRequestModification(java.lang.String queryId,
SearchRequest srq)
|
void |
printSettings(SearchRequest default_q,
java.lang.String[] topicsFiles,
java.lang.String otherComments)
prints the current settings to a file with the same name as the current results file. |
java.lang.String |
processQueries()
Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. |
java.lang.String |
processQueries(double c)
Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. |
java.lang.String |
processQueries(double c,
boolean c_set)
Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. |
SearchRequest |
processQuery(java.lang.String queryId,
java.lang.String query)
According to the given parameters, it sets up the correct matching class and performs retrieval for the given query. |
SearchRequest |
processQuery(java.lang.String queryId,
java.lang.String query,
double cParameter)
According to the given parameters, it sets up the correct matching class and performs retrieval for the given query. |
SearchRequest |
processQuery(java.lang.String queryId,
java.lang.String query,
double cParameter,
boolean c_set)
According to the given parameters, it sets up the correct matching class and performs retrieval for the given query. |
protected void |
processQueryAndWrite(java.lang.String queryId,
java.lang.String query,
double cParameter,
boolean c_set)
According to the given parameters, it sets up the correct matching class and performs retrieval for the given query. |
void |
setIndex(Index i)
Set the index pointer. |
protected void |
startingBatchOfQueries()
Before starting a batch of queries, this method is called by processQueries() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String defaultQEModel
protected static final org.apache.log4j.Logger logger
protected static boolean removeQueryPeriods
protected static final java.util.Random random
protected int matchingCount
protected boolean queryexpansion
protected java.io.PrintWriter resultFile
protected java.lang.String resultsFilename
protected static boolean DUMP_SETTINGS
protected java.lang.String managerName
protected Manager queryingManager
protected java.lang.String wModel
protected java.lang.String mModel
protected Index index
protected java.lang.String method
protected java.lang.String topicsParser
protected TRECQuerying.QuerySource querySource
protected TRECQuerying.OutputFormat printer
protected TRECQuerying.QueryResultCache resultsCache
Constructor Detail |
---|
public TRECQuerying()
public TRECQuerying(boolean _queryexpansion)
public TRECQuerying(Index i)
i
- The specified index.Method Detail |
---|
protected TRECQuerying.QueryResultCache getResultsCache()
protected TRECQuerying.OutputFormat getOutputFormat()
protected void createManager()
protected void loadIndex()
public Index getIndex()
public void setIndex(Index i)
i
- The index pointer.public Manager getManager()
public void close()
protected java.lang.String getNextQueryCounter(java.lang.String resultsFolder)
resultsFolder
- The path of the results folder.
protected java.lang.String getRandomQueryCounter()
protected java.lang.String getSequentialQueryCounter(java.lang.String resultsFolder)
resultsFolder
- The path of the results folder.
public java.io.PrintWriter getResultFile(java.lang.String predefinedName)
predefinedName
- java.lang.String a non-standard prefix for the result file.
public SearchRequest processQuery(java.lang.String queryId, java.lang.String query)
queryId
- the identifier of the query to process.query
- the query to process.public SearchRequest processQuery(java.lang.String queryId, java.lang.String query, double cParameter)
queryId
- the identifier of the query to process.query
- the query to process.cParameter
- double the value of the parameter to use.protected void processQueryAndWrite(java.lang.String queryId, java.lang.String query, double cParameter, boolean c_set)
queryId
- the identifier of the query to process.query
- the query to process.cParameter
- double the value of the parameter to use.c_set
- A boolean variable indicating if cParameter has been
specified.public SearchRequest processQuery(java.lang.String queryId, java.lang.String query, double cParameter, boolean c_set)
queryId
- the identifier of the query to process.query
- the query to process.cParameter
- double the value of the parameter to use.c_set
- boolean specifies whether the parameter c is set.protected void preQueryingSearchRequestModification(java.lang.String queryId, SearchRequest srq)
protected void initSearchRequestModification(java.lang.String queryId, SearchRequest srq)
public java.lang.String processQueries()
public java.lang.String processQueries(double c)
c
- double the value of the term frequency parameter to use.
protected TRECQuerying.QuerySource getQueryParser()
public java.lang.String processQueries(double c, boolean c_set)
Queries
Queries are parsed from file, specified by the trec.topics property
(comma delimited)
c
- the value of c.c_set
- specifies whether a value for c has been specified.
protected void startingBatchOfQueries()
protected void finishedQueries()
public void printSettings(SearchRequest default_q, java.lang.String[] topicsFiles, java.lang.String otherComments)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |