public class QualityBenchmark extends Object
There are two main configurations for running a quality benchmark:
Judge
.
The second configuration requires a non null
SubmissionLogger
.Modifier and Type | Field and Description |
---|---|
protected String |
docNameField
index field to extract doc name for each search result; used for judging the results.
|
protected QualityQueryParser |
qqParser
Parser for turning QualityQueries into Lucene Queries.
|
protected QualityQuery[] |
qualityQueries
Quality Queries that this quality benchmark would execute.
|
protected IndexSearcher |
searcher
Index to be searched.
|
Constructor and Description |
---|
QualityBenchmark(QualityQuery[] qqs,
QualityQueryParser qqParser,
IndexSearcher searcher,
String docNameField)
Create a QualityBenchmark.
|
Modifier and Type | Method and Description |
---|---|
QualityStats[] |
execute(Judge judge,
SubmissionReport submitRep,
PrintWriter qualityLog)
Run the quality benchmark.
|
int |
getMaxQueries() |
int |
getMaxResults() |
void |
setMaxQueries(int maxQueries)
Set the maximum number of quality queries to run.
|
void |
setMaxResults(int maxResults)
set the maximum number of results to collect for each quality query.
|
protected QualityQuery[] qualityQueries
protected QualityQueryParser qqParser
protected IndexSearcher searcher
protected String docNameField
public QualityBenchmark(QualityQuery[] qqs, QualityQueryParser qqParser, IndexSearcher searcher, String docNameField)
qqs
- quality queries to run.qqParser
- parser for turning QualityQueries into Lucene Queries.searcher
- index to be searched.docNameField
- name of field containing the document name.
This allows to extract the doc name for search results,
and is important for judging the results.public QualityStats[] execute(Judge judge, SubmissionReport submitRep, PrintWriter qualityLog) throws Exception
judge
- the judge that can tell if a certain result doc is relevant for a certain quality query.
If null, no judgements would be made. Usually null for a submission run.submitRep
- submission report is created if non null.qualityLog
- If not null, quality run data would be printed for each query.Exception
- if quality benchmark failed to run.public int getMaxQueries()
public void setMaxQueries(int maxQueries)
public int getMaxResults()
public void setMaxResults(int maxResults)