org.terrier.applications
Class TrecTerrier

java.lang.Object
  extended by org.terrier.applications.TrecTerrier

public class TrecTerrier
extends java.lang.Object

The text-based application that handles querying with Terrier, for TREC-like test collections. TrecTerrier, indexing TREC collections with Terrier.
usage: java TrecTerrier [flags in any order]

-h --help print this message
-V --version print version information
-i --index index a collection
-r --retrieve retrieve from an indexed collection
-e --evaluate evaluates the results in the directory
var/results with the specified qrels file
in the file etc/trec.qrels

If invoked with '-i', then both the direct and
inverted files are build, unless it is specified which
of the structures to build.
-d --direct creates the direct file
-v --inverted creates the inverted file, from an already existing direct

If invoked with '-r', there are the following options.
-c value parameter value for term frequency normalisation.
If it is not specified, then the default value for each
weighting model is used, eg PL2 => c=1, BM25 b=> 0.75
-q --queryexpand applies query expansion

If invoked with '-e', there is the following option.
-p --perquery reports the average precision for each query separately.
filename.res restrict evaluation to filename.res only.

If invoked with one of the following options, then the contents of the
corresponding data structure are shown in the standard output.
--printdocid prints the contents of the document index
--printlexicon prints the contents of the lexicon
--printinverted prints the contents of the inverted file
--printdirect prints the contents of the direct file
--printstats prints statistics about the indexed collection

Author:
Vassilis Plachouras

Field Summary
protected static int ARGUMENTS_OK
           
protected  double c
          The value of the term frequency normalisation parameter.
protected  boolean direct
          Specifies whether to build the direct file only.
protected static int ERROR_CONFLICTING_ARGUMENTS
           
protected static int ERROR_DIRECT_FILE_EXISTS
           
protected static int ERROR_DIRECT_FILE_NOT_EXISTS
           
protected static int ERROR_DIRECT_NOT_INDEXING
           
protected static int ERROR_EXPAND_NOT_RETRIEVE
           
protected static int ERROR_GIVEN_C_NOT_RETRIEVING
           
protected static int ERROR_HADOOP_NOT_RETRIEVAL
           
protected static int ERROR_HADOOP_ONLY_INDEX
           
protected static int ERROR_INVERTED_NOT_INDEXING
           
protected static int ERROR_LANGUAGEMODEL_NOT_RETRIEVE
           
protected static int ERROR_NO_ARGUMENTS
           
protected static int ERROR_NO_C_VALUE
           
protected static int ERROR_PRINT_DIRECT_FILE_NOT_EXISTS
           
protected static int ERROR_PRINT_DOCINDEX_FILE_NOT_EXISTS
           
protected static int ERROR_PRINT_INVERTED_FILE_NOT_EXISTS
           
protected static int ERROR_PRINT_LEXICON_FILE_NOT_EXISTS
           
protected static int ERROR_PRINT_STATS_FILE_NOT_EXISTS
           
protected static int ERROR_UNKNOWN_OPTION
           
protected  boolean evaluation
          Specifies whether to perform trec_eval like evaluation.
protected  boolean evaluation_per_query
          Specifies whether to perform trec_eval like evaluation, reporting only average precision for each query.
protected  java.lang.String evaluation_type
          Specifies if the evaluation is done for adhoc or named-page finding retrieval task.
protected  java.lang.String evaluationFilename
          The file to evaluation, if any
protected  boolean hadoop
          use Hadoop indexing
protected  boolean indexing
          Specifies whether to index a collection
protected  boolean inverted
          Specifies whether to build the inverted file from an already created direct file.
protected  boolean isParameterValueSpecified
          Indicates whether there is a specified value for the term frequency normalisation parameter.
protected  boolean printdirect
          Specifies whether to print the direct file
protected  boolean printdocid
          Specifies whether to print the document index
protected  boolean printHelp
          Specifies whether a help message is printed
protected  boolean printinverted
          Specifies whether to print the inverted file
protected  boolean printlexicon
          Specifies whether to print the lexicon
protected  boolean printmeta
          whether to print the meta index
protected  boolean printstats
          Specifies whether to print the statistics file
protected  boolean printVersion
          Specified whether a version message is printed
protected  boolean queryexpand
          Specifies whether to apply query expansion
protected  boolean retrieving
          Specifies whether to retrieve from an indexed collection
protected  boolean singlePass
          Specifies whether to build the inverted file from scrach, sigle pass method
protected  java.lang.String unknownOption
          The unkown option
 
Constructor Summary
TrecTerrier()
           
 
Method Summary
 void applyOptions(int status)
          Apply the option resulted from processing the command line arguments
static void main(java.lang.String[] args)
          The main method that starts the application
protected  int processOptions(java.lang.String[] args)
          Processes the command line arguments and sets the corresponding properties accordingly.
 void run()
          Calls the required classes from Terrier.
protected  void usage()
          Prints a help message that explains the possible options.
protected  void version()
          Prints the version information about Terrier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unknownOption

protected java.lang.String unknownOption
The unkown option


evaluationFilename

protected java.lang.String evaluationFilename
The file to evaluation, if any


queryexpand

protected boolean queryexpand
Specifies whether to apply query expansion


printHelp

protected boolean printHelp
Specifies whether a help message is printed


printVersion

protected boolean printVersion
Specified whether a version message is printed


indexing

protected boolean indexing
Specifies whether to index a collection


singlePass

protected boolean singlePass
Specifies whether to build the inverted file from scrach, sigle pass method


hadoop

protected boolean hadoop
use Hadoop indexing


retrieving

protected boolean retrieving
Specifies whether to retrieve from an indexed collection


printdocid

protected boolean printdocid
Specifies whether to print the document index


printlexicon

protected boolean printlexicon
Specifies whether to print the lexicon


printinverted

protected boolean printinverted
Specifies whether to print the inverted file


printdirect

protected boolean printdirect
Specifies whether to print the direct file


printstats

protected boolean printstats
Specifies whether to print the statistics file


printmeta

protected boolean printmeta
whether to print the meta index


evaluation_per_query

protected boolean evaluation_per_query
Specifies whether to perform trec_eval like evaluation, reporting only average precision for each query.


evaluation_type

protected java.lang.String evaluation_type
Specifies if the evaluation is done for adhoc or named-page finding retrieval task. adhoc by default.


inverted

protected boolean inverted
Specifies whether to build the inverted file from an already created direct file.


direct

protected boolean direct
Specifies whether to build the direct file only.


c

protected double c
The value of the term frequency normalisation parameter.


evaluation

protected boolean evaluation
Specifies whether to perform trec_eval like evaluation.


isParameterValueSpecified

protected boolean isParameterValueSpecified
Indicates whether there is a specified value for the term frequency normalisation parameter.


ARGUMENTS_OK

protected static final int ARGUMENTS_OK
See Also:
Constant Field Values

ERROR_NO_ARGUMENTS

protected static final int ERROR_NO_ARGUMENTS
See Also:
Constant Field Values

ERROR_NO_C_VALUE

protected static final int ERROR_NO_C_VALUE
See Also:
Constant Field Values

ERROR_CONFLICTING_ARGUMENTS

protected static final int ERROR_CONFLICTING_ARGUMENTS
See Also:
Constant Field Values

ERROR_DIRECT_FILE_EXISTS

protected static final int ERROR_DIRECT_FILE_EXISTS
See Also:
Constant Field Values

ERROR_DIRECT_FILE_NOT_EXISTS

protected static final int ERROR_DIRECT_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_PRINT_DOCINDEX_FILE_NOT_EXISTS

protected static final int ERROR_PRINT_DOCINDEX_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_PRINT_LEXICON_FILE_NOT_EXISTS

protected static final int ERROR_PRINT_LEXICON_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_PRINT_INVERTED_FILE_NOT_EXISTS

protected static final int ERROR_PRINT_INVERTED_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_PRINT_STATS_FILE_NOT_EXISTS

protected static final int ERROR_PRINT_STATS_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_PRINT_DIRECT_FILE_NOT_EXISTS

protected static final int ERROR_PRINT_DIRECT_FILE_NOT_EXISTS
See Also:
Constant Field Values

ERROR_UNKNOWN_OPTION

protected static final int ERROR_UNKNOWN_OPTION
See Also:
Constant Field Values

ERROR_DIRECT_NOT_INDEXING

protected static final int ERROR_DIRECT_NOT_INDEXING
See Also:
Constant Field Values

ERROR_INVERTED_NOT_INDEXING

protected static final int ERROR_INVERTED_NOT_INDEXING
See Also:
Constant Field Values

ERROR_EXPAND_NOT_RETRIEVE

protected static final int ERROR_EXPAND_NOT_RETRIEVE
See Also:
Constant Field Values

ERROR_GIVEN_C_NOT_RETRIEVING

protected static final int ERROR_GIVEN_C_NOT_RETRIEVING
See Also:
Constant Field Values

ERROR_LANGUAGEMODEL_NOT_RETRIEVE

protected static final int ERROR_LANGUAGEMODEL_NOT_RETRIEVE
See Also:
Constant Field Values

ERROR_HADOOP_NOT_RETRIEVAL

protected static final int ERROR_HADOOP_NOT_RETRIEVAL
See Also:
Constant Field Values

ERROR_HADOOP_ONLY_INDEX

protected static final int ERROR_HADOOP_ONLY_INDEX
See Also:
Constant Field Values
Constructor Detail

TrecTerrier

public TrecTerrier()
Method Detail

version

protected void version()
Prints the version information about Terrier


usage

protected void usage()
Prints a help message that explains the possible options.


main

public static void main(java.lang.String[] args)
The main method that starts the application

Parameters:
args - the command line arguments

processOptions

protected int processOptions(java.lang.String[] args)
Processes the command line arguments and sets the corresponding properties accordingly.

Parameters:
args - the command line arguments.
Returns:
int zero if the command line arguments are processed successfully, otherwise it returns an error code.

run

public void run()
         throws java.lang.Exception
Calls the required classes from Terrier.

Throws:
java.lang.Exception

applyOptions

public void applyOptions(int status)
                  throws java.lang.Exception
Apply the option resulted from processing the command line arguments

Parameters:
status - the status after process the command line arguments.
Throws:
java.lang.Exception


Terrier 3.5. Copyright © 2004-2011 University of Glasgow