Package org.terrier.applications
Class InteractiveQuerying
- java.lang.Object
-
- org.terrier.applications.AbstractQuerying
-
- org.terrier.applications.InteractiveQuerying
-
public class InteractiveQuerying extends AbstractQuerying
This class performs interactive querying at the command line. It asks for a query on Standard Input, and then displays the document IDs that match the given query.Properties:
- interactive.model - which weighting model to use, defaults to PL2
- interactive.matching - which Matching class to use, defaults to Matching
- interactive.manager - which Manager class to use, defaults to Matching
- Author:
- Gianni Amati, Vassilis Plachouras, Ben He, Craig Macdonald
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInteractiveQuerying.Command-
Nested classes/interfaces inherited from class org.terrier.applications.AbstractQuerying
AbstractQuerying.AbstractQueryingCommand
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINTERACTIVE_COMMANDprotected static org.slf4j.LoggerloggerThe logger usedprotected static booleanlowercaseChange to lowercase?protected java.lang.String[]metaKeysprotected booleanprintDocidprotected java.io.PrintWriterresultFileThe file to store the output to.protected static intRESULTS_LENGTHThe maximum number of presented results.protected booleanverbosedisplay user prompts-
Fields inherited from class org.terrier.applications.AbstractQuerying
controls, indexref, matchingCount, matchopQl, queryingManager
-
-
Constructor Summary
Constructors Constructor Description InteractiveQuerying()Deprecated.InteractiveQuerying(IndexRef iRef)A default constructor initialises the index, and the Manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the used structures.static voidmain(java.lang.String[] args)Starts the interactive query application.voidprintResults(java.io.PrintWriter pw, SearchRequest q)Prints the resultsvoidprocessQueries()Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism.SearchRequestprocessQuery(java.lang.String queryId, java.lang.String query)According to the given parameters, it sets up the correct matching class.-
Methods inherited from class org.terrier.applications.AbstractQuerying
controls, createManager
-
-
-
-
Field Detail
-
INTERACTIVE_COMMAND
public static final java.lang.String INTERACTIVE_COMMAND
- See Also:
- Constant Field Values
-
logger
protected static final org.slf4j.Logger logger
The logger used
-
lowercase
protected static final boolean lowercase
Change to lowercase?
-
verbose
protected boolean verbose
display user prompts
-
resultFile
protected java.io.PrintWriter resultFile
The file to store the output to.
-
RESULTS_LENGTH
protected static int RESULTS_LENGTH
The maximum number of presented results.
-
metaKeys
protected java.lang.String[] metaKeys
-
printDocid
protected boolean printDocid
-
-
Constructor Detail
-
InteractiveQuerying
public InteractiveQuerying(IndexRef iRef)
A default constructor initialises the index, and the Manager.
-
InteractiveQuerying
@Deprecated public InteractiveQuerying()
Deprecated.
-
-
Method Detail
-
close
public void close()
Closes the used structures.
-
processQuery
public SearchRequest processQuery(java.lang.String queryId, java.lang.String query)
According to the given parameters, it sets up the correct matching class.- Overrides:
processQueryin classAbstractQuerying- Parameters:
queryId- String the query identifier to use.query- String the query to process.
-
processQueries
public void processQueries()
Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. It parses the file with the queries (the name of the file is defined in the address_query file), creates the file of results, and for each query, gets the relevant documents, scores them, and outputs the results to the result file.
-
printResults
public void printResults(java.io.PrintWriter pw, SearchRequest q) throws java.io.IOExceptionPrints the results- Parameters:
pw- PrintWriter the file to write the results to.q- SearchRequest the search request to get results from.- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args)
Starts the interactive query application.- Parameters:
args- the command line arguments.
-
-