Skip to content

Commit 825148a

Browse files
authored
Major refactoring of search code paths (#2310)
+ Improved alignment between SearchCollection and dense vector search classes. + Aligned ScoredDoc and ScoredDocs (was previously ScoredDocuments) as container objects for Lucene results. + Searchers now use ScoredDoc instead of class-specific Result objects. + Tweaked SearchCollection args to use proper camelCasing. + Consolidated BaseSearcher class for basic ranked list post-processing functionality. + Increased test coverage.
1 parent ff16957 commit 825148a

File tree

59 files changed

+3142
-2776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3142
-2776
lines changed

docs/regressions/regressions-backgroundlinking18.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ target/appassembler/bin/SearchCollection \
4747
-topics tools/topics-and-qrels/topics.backgroundlinking18.txt \
4848
-topicReader BackgroundLinking \
4949
-output runs/run.wapo.v2.bm25.topics.backgroundlinking18.txt \
50-
-backgroundlinking -backgroundlinking.k 100 -bm25 -hits 100 &
50+
-backgroundLinking -backgroundLinking.k 100 -bm25 -hits 100 &
5151
5252
target/appassembler/bin/SearchCollection \
5353
-index indexes/lucene-index.wapo.v2/ \
5454
-topics tools/topics-and-qrels/topics.backgroundlinking18.txt \
5555
-topicReader BackgroundLinking \
5656
-output runs/run.wapo.v2.bm25+rm3.topics.backgroundlinking18.txt \
57-
-backgroundlinking -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
57+
-backgroundLinking -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
5858
5959
target/appassembler/bin/SearchCollection \
6060
-index indexes/lucene-index.wapo.v2/ \
6161
-topics tools/topics-and-qrels/topics.backgroundlinking18.txt \
6262
-topicReader BackgroundLinking \
6363
-output runs/run.wapo.v2.bm25+rm3+df.topics.backgroundlinking18.txt \
64-
-backgroundlinking -backgroundlinking.datefilter -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
64+
-backgroundLinking -backgroundLinking.dateFilter -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
6565
```
6666

6767
Evaluation can be performed using `trec_eval`:

docs/regressions/regressions-backgroundlinking19.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ target/appassembler/bin/SearchCollection \
4747
-topics tools/topics-and-qrels/topics.backgroundlinking19.txt \
4848
-topicReader BackgroundLinking \
4949
-output runs/run.wapo.v2.bm25.topics.backgroundlinking19.txt \
50-
-backgroundlinking -backgroundlinking.k 100 -bm25 -hits 100 &
50+
-backgroundLinking -backgroundLinking.k 100 -bm25 -hits 100 &
5151
5252
target/appassembler/bin/SearchCollection \
5353
-index indexes/lucene-index.wapo.v2/ \
5454
-topics tools/topics-and-qrels/topics.backgroundlinking19.txt \
5555
-topicReader BackgroundLinking \
5656
-output runs/run.wapo.v2.bm25+rm3.topics.backgroundlinking19.txt \
57-
-backgroundlinking -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
57+
-backgroundLinking -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
5858
5959
target/appassembler/bin/SearchCollection \
6060
-index indexes/lucene-index.wapo.v2/ \
6161
-topics tools/topics-and-qrels/topics.backgroundlinking19.txt \
6262
-topicReader BackgroundLinking \
6363
-output runs/run.wapo.v2.bm25+rm3+df.topics.backgroundlinking19.txt \
64-
-backgroundlinking -backgroundlinking.datefilter -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
64+
-backgroundLinking -backgroundLinking.dateFilter -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
6565
```
6666

6767
Evaluation can be performed using `trec_eval`:

docs/regressions/regressions-backgroundlinking20.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ target/appassembler/bin/SearchCollection \
4747
-topics tools/topics-and-qrels/topics.backgroundlinking20.txt \
4848
-topicReader BackgroundLinking \
4949
-output runs/run.wapo.v3.bm25.topics.backgroundlinking20.txt \
50-
-backgroundlinking -backgroundlinking.k 100 -bm25 -hits 100 &
50+
-backgroundLinking -backgroundLinking.k 100 -bm25 -hits 100 &
5151
5252
target/appassembler/bin/SearchCollection \
5353
-index indexes/lucene-index.wapo.v3/ \
5454
-topics tools/topics-and-qrels/topics.backgroundlinking20.txt \
5555
-topicReader BackgroundLinking \
5656
-output runs/run.wapo.v3.bm25+rm3.topics.backgroundlinking20.txt \
57-
-backgroundlinking -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
57+
-backgroundLinking -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
5858
5959
target/appassembler/bin/SearchCollection \
6060
-index indexes/lucene-index.wapo.v3/ \
6161
-topics tools/topics-and-qrels/topics.backgroundlinking20.txt \
6262
-topicReader BackgroundLinking \
6363
-output runs/run.wapo.v3.bm25+rm3+df.topics.backgroundlinking20.txt \
64-
-backgroundlinking -backgroundlinking.datefilter -backgroundlinking.k 100 -bm25 -rm3 -hits 100 &
64+
-backgroundLinking -backgroundLinking.dateFilter -backgroundLinking.k 100 -bm25 -rm3 -hits 100 &
6565
```
6666

6767
Evaluation can be performed using `trec_eval`:

docs/regressions/regressions-mb11.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,78 +56,78 @@ target/appassembler/bin/SearchCollection \
5656
-topics tools/topics-and-qrels/topics.microblog2011.txt \
5757
-topicReader Microblog \
5858
-output runs/run.mb11.bm25.topics.microblog2011.txt \
59-
-searchtweets -bm25 &
59+
-searchTweets -bm25 &
6060
target/appassembler/bin/SearchCollection \
6161
-index indexes/lucene-index.mb11/ \
6262
-topics tools/topics-and-qrels/topics.microblog2012.txt \
6363
-topicReader Microblog \
6464
-output runs/run.mb11.bm25.topics.microblog2012.txt \
65-
-searchtweets -bm25 &
65+
-searchTweets -bm25 &
6666
6767
target/appassembler/bin/SearchCollection \
6868
-index indexes/lucene-index.mb11/ \
6969
-topics tools/topics-and-qrels/topics.microblog2011.txt \
7070
-topicReader Microblog \
7171
-output runs/run.mb11.bm25+rm3.topics.microblog2011.txt \
72-
-searchtweets -bm25 -rm3 &
72+
-searchTweets -bm25 -rm3 &
7373
target/appassembler/bin/SearchCollection \
7474
-index indexes/lucene-index.mb11/ \
7575
-topics tools/topics-and-qrels/topics.microblog2012.txt \
7676
-topicReader Microblog \
7777
-output runs/run.mb11.bm25+rm3.topics.microblog2012.txt \
78-
-searchtweets -bm25 -rm3 &
78+
-searchTweets -bm25 -rm3 &
7979
8080
target/appassembler/bin/SearchCollection \
8181
-index indexes/lucene-index.mb11/ \
8282
-topics tools/topics-and-qrels/topics.microblog2011.txt \
8383
-topicReader Microblog \
8484
-output runs/run.mb11.bm25+ax.topics.microblog2011.txt \
85-
-searchtweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
85+
-searchTweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
8686
target/appassembler/bin/SearchCollection \
8787
-index indexes/lucene-index.mb11/ \
8888
-topics tools/topics-and-qrels/topics.microblog2012.txt \
8989
-topicReader Microblog \
9090
-output runs/run.mb11.bm25+ax.topics.microblog2012.txt \
91-
-searchtweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
91+
-searchTweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
9292
9393
target/appassembler/bin/SearchCollection \
9494
-index indexes/lucene-index.mb11/ \
9595
-topics tools/topics-and-qrels/topics.microblog2011.txt \
9696
-topicReader Microblog \
9797
-output runs/run.mb11.ql.topics.microblog2011.txt \
98-
-searchtweets -qld &
98+
-searchTweets -qld &
9999
target/appassembler/bin/SearchCollection \
100100
-index indexes/lucene-index.mb11/ \
101101
-topics tools/topics-and-qrels/topics.microblog2012.txt \
102102
-topicReader Microblog \
103103
-output runs/run.mb11.ql.topics.microblog2012.txt \
104-
-searchtweets -qld &
104+
-searchTweets -qld &
105105
106106
target/appassembler/bin/SearchCollection \
107107
-index indexes/lucene-index.mb11/ \
108108
-topics tools/topics-and-qrels/topics.microblog2011.txt \
109109
-topicReader Microblog \
110110
-output runs/run.mb11.ql+rm3.topics.microblog2011.txt \
111-
-searchtweets -qld -rm3 &
111+
-searchTweets -qld -rm3 &
112112
target/appassembler/bin/SearchCollection \
113113
-index indexes/lucene-index.mb11/ \
114114
-topics tools/topics-and-qrels/topics.microblog2012.txt \
115115
-topicReader Microblog \
116116
-output runs/run.mb11.ql+rm3.topics.microblog2012.txt \
117-
-searchtweets -qld -rm3 &
117+
-searchTweets -qld -rm3 &
118118
119119
target/appassembler/bin/SearchCollection \
120120
-index indexes/lucene-index.mb11/ \
121121
-topics tools/topics-and-qrels/topics.microblog2011.txt \
122122
-topicReader Microblog \
123123
-output runs/run.mb11.ql+ax.topics.microblog2011.txt \
124-
-searchtweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
124+
-searchTweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
125125
target/appassembler/bin/SearchCollection \
126126
-index indexes/lucene-index.mb11/ \
127127
-topics tools/topics-and-qrels/topics.microblog2012.txt \
128128
-topicReader Microblog \
129129
-output runs/run.mb11.ql+ax.topics.microblog2012.txt \
130-
-searchtweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
130+
-searchTweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
131131
```
132132

133133
Evaluation can be performed using `trec_eval`:

docs/regressions/regressions-mb13.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,78 +56,78 @@ target/appassembler/bin/SearchCollection \
5656
-topics tools/topics-and-qrels/topics.microblog2013.txt \
5757
-topicReader Microblog \
5858
-output runs/run.mb13.bm25.topics.microblog2013.txt \
59-
-searchtweets -bm25 &
59+
-searchTweets -bm25 &
6060
target/appassembler/bin/SearchCollection \
6161
-index indexes/lucene-index.mb13/ \
6262
-topics tools/topics-and-qrels/topics.microblog2014.txt \
6363
-topicReader Microblog \
6464
-output runs/run.mb13.bm25.topics.microblog2014.txt \
65-
-searchtweets -bm25 &
65+
-searchTweets -bm25 &
6666
6767
target/appassembler/bin/SearchCollection \
6868
-index indexes/lucene-index.mb13/ \
6969
-topics tools/topics-and-qrels/topics.microblog2013.txt \
7070
-topicReader Microblog \
7171
-output runs/run.mb13.bm25+rm3.topics.microblog2013.txt \
72-
-searchtweets -bm25 -rm3 &
72+
-searchTweets -bm25 -rm3 &
7373
target/appassembler/bin/SearchCollection \
7474
-index indexes/lucene-index.mb13/ \
7575
-topics tools/topics-and-qrels/topics.microblog2014.txt \
7676
-topicReader Microblog \
7777
-output runs/run.mb13.bm25+rm3.topics.microblog2014.txt \
78-
-searchtweets -bm25 -rm3 &
78+
-searchTweets -bm25 -rm3 &
7979
8080
target/appassembler/bin/SearchCollection \
8181
-index indexes/lucene-index.mb13/ \
8282
-topics tools/topics-and-qrels/topics.microblog2013.txt \
8383
-topicReader Microblog \
8484
-output runs/run.mb13.bm25+ax.topics.microblog2013.txt \
85-
-searchtweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
85+
-searchTweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
8686
target/appassembler/bin/SearchCollection \
8787
-index indexes/lucene-index.mb13/ \
8888
-topics tools/topics-and-qrels/topics.microblog2014.txt \
8989
-topicReader Microblog \
9090
-output runs/run.mb13.bm25+ax.topics.microblog2014.txt \
91-
-searchtweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
91+
-searchTweets -bm25 -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
9292
9393
target/appassembler/bin/SearchCollection \
9494
-index indexes/lucene-index.mb13/ \
9595
-topics tools/topics-and-qrels/topics.microblog2013.txt \
9696
-topicReader Microblog \
9797
-output runs/run.mb13.ql.topics.microblog2013.txt \
98-
-searchtweets -qld &
98+
-searchTweets -qld &
9999
target/appassembler/bin/SearchCollection \
100100
-index indexes/lucene-index.mb13/ \
101101
-topics tools/topics-and-qrels/topics.microblog2014.txt \
102102
-topicReader Microblog \
103103
-output runs/run.mb13.ql.topics.microblog2014.txt \
104-
-searchtweets -qld &
104+
-searchTweets -qld &
105105
106106
target/appassembler/bin/SearchCollection \
107107
-index indexes/lucene-index.mb13/ \
108108
-topics tools/topics-and-qrels/topics.microblog2013.txt \
109109
-topicReader Microblog \
110110
-output runs/run.mb13.ql+rm3.topics.microblog2013.txt \
111-
-searchtweets -qld -rm3 &
111+
-searchTweets -qld -rm3 &
112112
target/appassembler/bin/SearchCollection \
113113
-index indexes/lucene-index.mb13/ \
114114
-topics tools/topics-and-qrels/topics.microblog2014.txt \
115115
-topicReader Microblog \
116116
-output runs/run.mb13.ql+rm3.topics.microblog2014.txt \
117-
-searchtweets -qld -rm3 &
117+
-searchTweets -qld -rm3 &
118118
119119
target/appassembler/bin/SearchCollection \
120120
-index indexes/lucene-index.mb13/ \
121121
-topics tools/topics-and-qrels/topics.microblog2013.txt \
122122
-topicReader Microblog \
123123
-output runs/run.mb13.ql+ax.topics.microblog2013.txt \
124-
-searchtweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
124+
-searchTweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
125125
target/appassembler/bin/SearchCollection \
126126
-index indexes/lucene-index.mb13/ \
127127
-topics tools/topics-and-qrels/topics.microblog2014.txt \
128128
-topicReader Microblog \
129129
-output runs/run.mb13.ql+ax.topics.microblog2014.txt \
130-
-searchtweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
130+
-searchTweets -qld -axiom -axiom.beta 1.0 -axiom.deterministic -rerankCutoff 20 &
131131
```
132132

133133
Evaluation can be performed using `trec_eval`:

docs/regressions/regressions-msmarco-passage-ca.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Typical indexing command:
2121
```
2222
target/appassembler/bin/IndexCollection \
2323
-collection JsonCollection \
24-
-input /path/to/msmarco-wp \
24+
-input /path/to/msmarco-passage \
2525
-generator DefaultLuceneDocumentGenerator \
2626
-index indexes/lucene-index.msmarco-passage-ca/ \
2727
-threads 9 -storePositions -storeDocvectors -storeRaw -analyzeWithHuggingFaceTokenizer bert-base-uncased -useCompositeAnalyzer \
28-
>& logs/log.msmarco-wp &
28+
>& logs/log.msmarco-passage &
2929
```
3030

3131
The directory `/path/to/msmarco-passage-wp/` should be a directory containing the corpus in Anserini's jsonl format.
@@ -44,17 +44,17 @@ target/appassembler/bin/SearchCollection \
4444
-index indexes/lucene-index.msmarco-passage-ca/ \
4545
-topics tools/topics-and-qrels/topics.msmarco-passage.dev-subset.txt \
4646
-topicReader TsvInt \
47-
-output runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt \
48-
-bm25 -analyzeWithHuggingFaceTokenizer bert-base-uncased -useCompositeAnalyzer &
47+
-output runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt \
48+
-bm25 -analyzeWithHuggingFaceTokenizer bert-base-uncased -useCompositeAnalyzer &
4949
```
5050

5151
Evaluation can be performed using `trec_eval`:
5252

5353
```
54-
tools/eval/trec_eval.9.0.4/trec_eval -c -m map tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
55-
tools/eval/trec_eval.9.0.4/trec_eval -c -M 10 -m recip_rank tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
56-
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.100 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
57-
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.1000 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
54+
tools/eval/trec_eval.9.0.4/trec_eval -c -m map tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
55+
tools/eval/trec_eval.9.0.4/trec_eval -c -M 10 -m recip_rank tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
56+
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.100 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
57+
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.1000 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
5858
```
5959

6060
## Effectiveness

docs/regressions/regressions-msmarco-passage-hgf-wp.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Typical indexing command:
2323
```
2424
target/appassembler/bin/IndexCollection \
2525
-collection JsonCollection \
26-
-input /path/to/msmarco-wp \
26+
-input /path/to/msmarco-passage \
2727
-generator DefaultLuceneDocumentGenerator \
2828
-index indexes/lucene-index.msmarco-passage-hgf-wp/ \
2929
-threads 9 -storePositions -storeDocvectors -storeRaw -analyzeWithHuggingFaceTokenizer bert-base-uncased \
30-
>& logs/log.msmarco-wp &
30+
>& logs/log.msmarco-passage &
3131
```
3232

3333
The directory `/path/to/msmarco-passage-wp/` should be a directory containing the corpus in Anserini's jsonl format.
@@ -46,17 +46,17 @@ target/appassembler/bin/SearchCollection \
4646
-index indexes/lucene-index.msmarco-passage-hgf-wp/ \
4747
-topics tools/topics-and-qrels/topics.msmarco-passage.dev-subset.txt \
4848
-topicReader TsvInt \
49-
-output runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt \
50-
-bm25 -analyzeWithHuggingFaceTokenizer bert-base-uncased &
49+
-output runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt \
50+
-bm25 -analyzeWithHuggingFaceTokenizer bert-base-uncased &
5151
```
5252

5353
Evaluation can be performed using `trec_eval`:
5454

5555
```
56-
tools/eval/trec_eval.9.0.4/trec_eval -c -m map tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
57-
tools/eval/trec_eval.9.0.4/trec_eval -c -M 10 -m recip_rank tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
58-
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.100 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
59-
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.1000 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-wp.bm25-default.topics.msmarco-passage.dev-subset.txt
56+
tools/eval/trec_eval.9.0.4/trec_eval -c -m map tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
57+
tools/eval/trec_eval.9.0.4/trec_eval -c -M 10 -m recip_rank tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
58+
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.100 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
59+
tools/eval/trec_eval.9.0.4/trec_eval -c -m recall.1000 tools/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt runs/run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt
6060
```
6161

6262
## Effectiveness

src/main/java/io/anserini/rerank/Reranker.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
package io.anserini.rerank;
1818

19+
import io.anserini.search.ScoredDocs;
20+
1921
public interface Reranker<T> {
20-
ScoredDocuments rerank(ScoredDocuments docs, RerankerContext<T> context);
22+
ScoredDocs rerank(ScoredDocs docs, RerankerContext<T> context);
2123
String tag();
2224
}

src/main/java/io/anserini/rerank/RerankerCascade.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package io.anserini.rerank;
1818

19+
import io.anserini.search.ScoredDocs;
20+
1921
import java.util.ArrayList;
2022
import java.util.List;
2123

@@ -57,8 +59,8 @@ public RerankerCascade add(Reranker reranker) {
5759
* @return reranked results
5860
*/
5961
@SuppressWarnings("unchecked")
60-
public ScoredDocuments run(ScoredDocuments docs, RerankerContext context) {
61-
ScoredDocuments results = docs;
62+
public ScoredDocs run(ScoredDocs docs, RerankerContext context) {
63+
ScoredDocs results = docs;
6264

6365
for (Reranker reranker : rerankers) {
6466
results = reranker.rerank(results, context);

0 commit comments

Comments
 (0)