本文整理汇总了Java中org.apache.lucene.benchmark.quality.trec.TrecJudge类的典型用法代码示例。如果您正苦于以下问题:Java TrecJudge类的具体用法?Java TrecJudge怎么用?Java TrecJudge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrecJudge类属于org.apache.lucene.benchmark.quality.trec包,在下文中一共展示了TrecJudge类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.apache.lucene.benchmark.quality.trec.TrecJudge; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
File topicsFile = new File("aos/lucene/benchmark/topics.txt");
File qrelsFile = new File("aos/lucene/benchmark/qrels.txt");
Directory dir = FSDirectory.open(new File("indexes/MeetLucene"));
IndexReader reader = DirectoryReader.open(dir);
IndexSearcher searcher = new IndexSearcher(reader);
String docNameField = "filename";
PrintWriter LOGGER = new PrintWriter(System.out, true);
TrecTopicsReader qReader = new TrecTopicsReader();
QualityQuery qqs[] = qReader.readQueries(new BufferedReader(new FileReader(topicsFile)));
Judge judge = new TrecJudge(new BufferedReader(new FileReader(qrelsFile)));
judge.validateData(qqs, LOGGER);
QualityQueryParser qqParser = new SimpleQQParser("title", "contents");
QualityBenchmark qrun = new QualityBenchmark(qqs, qqParser, searcher, docNameField);
SubmissionReport submitLog = null;
QualityStats stats[] = qrun.execute(judge, submitLog, LOGGER);
QualityStats avg = QualityStats.average(stats);
avg.log("SUMMARY", 2, LOGGER, " ");
dir.close();
}