-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added formal regression for MS MARCO passage task #692
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Anserini: Experiments on [MS MARCO (Passage)](https://github.com/microsoft/MSMARCO-Passage-Ranking) | ||
|
||
This page documents regression experiments for the MS MARCO Passage Ranking Task, which is integrated into Anserini's regression testing framework. | ||
For more complete instructions on how to run end-to-end experiments, refer to a [separate page](experiments-msmarco.md). | ||
|
||
## Indexing | ||
|
||
Typical indexing command: | ||
|
||
``` | ||
nohup sh target/appassembler/bin/IndexCollection -collection JsonCollection \ | ||
-generator LuceneDocumentGenerator -threads 9 -input /path/to/msmarco-passage \ | ||
-index lucene-index.msmarco-passage.pos+docvectors+rawdocs -storePositions \ | ||
-storeDocvectors -storeRawDocs >& log.msmarco-passage.pos+docvectors+rawdocs & | ||
``` | ||
|
||
The directory `/path/to/msmarco-passage/` should be a directory containing `jsonl` files converted from the official passage collection, which is in `tsv` format. | ||
[This page](experiments-msmarco.md) explains how to perform this conversion. | ||
|
||
For additional details, see explanation of [common indexing options](common-indexing-options.md). | ||
|
||
## Retrieval | ||
|
||
Topics and qrels are stored in `src/main/resources/topics-and-qrels/`. | ||
The regression experiments here evaluate on the 6980 dev set questions; see [this page](experiments-msmarco.md) for more details. | ||
|
||
After indexing has completed, you should be able to perform retrieval as follows: | ||
|
||
``` | ||
nohup target/appassembler/bin/SearchCollection -topicreader Tsv -index lucene-index.msmarco-passage.pos+docvectors+rawdocs -topics src/main/resources/topics-and-qrels/topics.msmarco-passage.dev-subset.txt -output run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt -bm25 & | ||
|
||
nohup target/appassembler/bin/SearchCollection -topicreader Tsv -index lucene-index.msmarco-passage.pos+docvectors+rawdocs -topics src/main/resources/topics-and-qrels/topics.msmarco-passage.dev-subset.txt -output run.msmarco-passage.bm25-default+rm3.topics.msmarco-passage.dev-subset.txt -bm25 -rm3 & | ||
|
||
nohup target/appassembler/bin/SearchCollection -topicreader Tsv -index lucene-index.msmarco-passage.pos+docvectors+rawdocs -topics src/main/resources/topics-and-qrels/topics.msmarco-passage.dev-subset.txt -output run.msmarco-passage.bm25-tuned.topics.msmarco-passage.dev-subset.txt -bm25 -k1 0.82 -b 0.72 & | ||
|
||
nohup target/appassembler/bin/SearchCollection -topicreader Tsv -index lucene-index.msmarco-passage.pos+docvectors+rawdocs -topics src/main/resources/topics-and-qrels/topics.msmarco-passage.dev-subset.txt -output run.msmarco-passage.bm25-tuned+rm3.topics.msmarco-passage.dev-subset.txt -bm25 -k1 0.82 -b 0.72 -rm3 & | ||
|
||
``` | ||
|
||
Evaluation can be performed using `trec_eval`: | ||
|
||
``` | ||
eval/trec_eval.9.0.4/trec_eval -m map -m recall.1000 src/main/resources/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt run.msmarco-passage.bm25-default.topics.msmarco-passage.dev-subset.txt | ||
rodrigonogueira4 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
eval/trec_eval.9.0.4/trec_eval -m map -m recall.1000 src/main/resources/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt run.msmarco-passage.bm25-default+rm3.topics.msmarco-passage.dev-subset.txt | ||
|
||
eval/trec_eval.9.0.4/trec_eval -m map -m recall.1000 src/main/resources/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt run.msmarco-passage.bm25-tuned.topics.msmarco-passage.dev-subset.txt | ||
|
||
eval/trec_eval.9.0.4/trec_eval -m map -m recall.1000 src/main/resources/topics-and-qrels/qrels.msmarco-passage.dev-subset.txt run.msmarco-passage.bm25-tuned+rm3.topics.msmarco-passage.dev-subset.txt | ||
|
||
``` | ||
|
||
## Effectiveness | ||
|
||
With the above commands, you should be able to replicate the following results: | ||
|
||
MAP | BM25 (Default)| +RM3 | BM25 (Tuned)| +RM3 | | ||
:---------------------------------------|-----------|-----------|-----------|-----------| | ||
[MS MARCO Passage Ranking: Dev Queries](https://github.com/microsoft/MSMARCO-Passage-Ranking)| 0.1924 | 0.1661 | 0.1956 | 0.1766 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Amazing! |
||
|
||
|
||
R@1000 | BM25 (Default)| +RM3 | BM25 (Tuned)| +RM3 | | ||
:---------------------------------------|-----------|-----------|-----------|-----------| | ||
[MS MARCO Passage Ranking: Dev Queries](https://github.com/microsoft/MSMARCO-Passage-Ranking)| 0.8526 | 0.8606 | 0.8578 | 0.8701 | | ||
|
||
|
||
|
||
The setting "default" refers the default BM25 settings of `k1=0.9`, `b=0.4`, while "tuned" refers to the tuned setting of `k1=0.82`, `b=0.72`. | ||
See [this page](experiments-msmarco.md) for more details. | ||
Note that these results are slightly different from the above referenced page because those experiments make up "fake" scores when converting runs from MS MARCO format into TREC format for evaluation by `trec_eval`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/io/anserini/search/topicreader/TsvTopicReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Anserini: A Lucene toolkit for replicable information retrieval research | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.anserini.search.topicreader; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.SortedMap; | ||
import java.util.TreeMap; | ||
|
||
/** | ||
* Topic reader for queries in tsv format, such as the MS MARCO queries. | ||
* | ||
* <pre> | ||
* 174249 does xpress bet charge to deposit money in your account | ||
* 320792 how much is a cost to run disneyland | ||
* 1090270 botulinum definition | ||
* 1101279 do physicians pay for insurance from their salaries? | ||
* 201376 here there be dragons comic | ||
* 54544 blood diseases that are sexually transmitted | ||
* ... | ||
* </pre> | ||
*/ | ||
public class TsvTopicReader extends TopicReader { | ||
public TsvTopicReader(Path topicFile) { | ||
super(topicFile); | ||
} | ||
|
||
@Override | ||
public SortedMap<Integer, Map<String, String>> read(BufferedReader reader) throws IOException { | ||
SortedMap<Integer, Map<String, String>> map = new TreeMap<>(); | ||
|
||
String line; | ||
while ((line = reader.readLine()) != null) { | ||
line = line.trim(); | ||
String[] arr = line.split("\\t"); | ||
|
||
Map<String,String> fields = new HashMap<>(); | ||
fields.put("title", arr[1].trim()); | ||
map.put(Integer.valueOf(arr[0]), fields); | ||
} | ||
|
||
return map; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/resources/docgen/templates/msmarco-passage.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Anserini: Experiments on [MS MARCO (Passage)](https://github.com/microsoft/MSMARCO-Passage-Ranking) | ||
|
||
This page documents regression experiments for the MS MARCO Passage Ranking Task, which is integrated into Anserini's regression testing framework. | ||
For more complete instructions on how to run end-to-end experiments, refer to a [separate page](experiments-msmarco.md). | ||
|
||
## Indexing | ||
|
||
Typical indexing command: | ||
|
||
``` | ||
${index_cmds} | ||
``` | ||
|
||
The directory `/path/to/msmarco-passage/` should be a directory containing `jsonl` files converted from the official passage collection, which is in `tsv` format. | ||
[This page](experiments-msmarco.md) explains how to perform this conversion. | ||
|
||
For additional details, see explanation of [common indexing options](common-indexing-options.md). | ||
|
||
## Retrieval | ||
|
||
Topics and qrels are stored in `src/main/resources/topics-and-qrels/`. | ||
The regression experiments here evaluate on the 6980 dev set questions; see [this page](experiments-msmarco.md) for more details. | ||
|
||
After indexing has completed, you should be able to perform retrieval as follows: | ||
|
||
``` | ||
${ranking_cmds} | ||
``` | ||
|
||
Evaluation can be performed using `trec_eval`: | ||
|
||
``` | ||
${eval_cmds} | ||
``` | ||
|
||
## Effectiveness | ||
|
||
With the above commands, you should be able to replicate the following results: | ||
|
||
${effectiveness} | ||
|
||
The setting "default" refers the default BM25 settings of `k1=0.9`, `b=0.4`, while "tuned" refers to the tuned setting of `k1=0.82`, `b=0.72`. | ||
See [this page](experiments-msmarco.md) for more details. | ||
Note that these results are slightly different from the above referenced page because those experiments make up "fake" scores when converting runs from MS MARCO format into TREC format for evaluation by `trec_eval`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!