Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 5.56 KB

regressions-beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.onnx.md

File metadata and controls

83 lines (60 loc) · 5.56 KB

Anserini Regressions: BEIR (v1.0.0) — CQADupStack-wordpress

Model: SPLADE++ CoCondenser-EnsembleDistil (using ONNX for on-the-fly query encoding)

This page describes regression experiments, integrated into Anserini's regression testing framework, using SPLADE++ CoCondenser-EnsembleDistil on BEIR (v1.0.0) — CQADupStack-wordpress. The model itself can be download here. See the official SPLADE repo and the following paper for more details:

Thibault Formal, Carlos Lassance, Benjamin Piwowarski, and Stéphane Clinchant. From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective. Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2353–2359.

In these experiments, we are using ONNX to perform query encoding on the fly.

The exact configurations for these regressions are stored in this YAML file. Note that this page is automatically generated from this template as part of Anserini's regression pipeline, so do not modify this page directly; modify the template instead and then run bin/build.sh to rebuild the documentation.

From one of our Waterloo servers (e.g., orca), the following command will perform the complete regression, end to end:

python src/main/python/run_regression.py --index --verify --search --regression beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.onnx

All the BEIR corpora, encoded by the SPLADE++ CoCondenser-EnsembleDistil model, are available for download:

wget https://rgw.cs.uwaterloo.ca/pyserini/data/beir-v1.0.0-splade-pp-ed.tar -P collections/
tar xvf collections/beir-v1.0.0-splade-pp-ed.tar -C collections/

The tarball is 42 GB and has MD5 checksum 9c7de5b444a788c9e74c340bf833173b. After download and unpacking the corpora, the run_regression.py command above should work without any issue.

Indexing

Sample indexing command:

bin/run.sh io.anserini.index.IndexCollection \
  -threads 16 \
  -collection JsonVectorCollection \
  -input /path/to/beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed \
  -generator DefaultLuceneDocumentGenerator \
  -index indexes/lucene-inverted.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed/ \
  -impact -pretokenized \
  >& logs/log.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed &

The important indexing options to note here are -impact -pretokenized: the first tells Anserini not to encode BM25 doclengths into Lucene's norms (which is the default) and the second option says not to apply any additional tokenization on the pre-encoded tokens. For additional details, see explanation of common indexing options.

Retrieval

Topics and qrels are stored here, which is linked to the Anserini repo as a submodule.

After indexing has completed, you should be able to perform retrieval as follows:

bin/run.sh io.anserini.search.SearchCollection \
  -index indexes/lucene-inverted.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed/ \
  -topics tools/topics-and-qrels/topics.beir-v1.0.0-cqadupstack-wordpress.test.tsv.gz \
  -topicReader TsvString \
  -output runs/run.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.splade-pp-ed-onnx.topics.beir-v1.0.0-cqadupstack-wordpress.test.txt \
  -impact -pretokenized -removeQuery -hits 1000 -encoder SpladePlusPlusEnsembleDistil &

Evaluation can be performed using trec_eval:

bin/trec_eval -c -m ndcg_cut.10 tools/topics-and-qrels/qrels.beir-v1.0.0-cqadupstack-wordpress.test.txt runs/run.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.splade-pp-ed-onnx.topics.beir-v1.0.0-cqadupstack-wordpress.test.txt
bin/trec_eval -c -m recall.100 tools/topics-and-qrels/qrels.beir-v1.0.0-cqadupstack-wordpress.test.txt runs/run.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.splade-pp-ed-onnx.topics.beir-v1.0.0-cqadupstack-wordpress.test.txt
bin/trec_eval -c -m recall.1000 tools/topics-and-qrels/qrels.beir-v1.0.0-cqadupstack-wordpress.test.txt runs/run.beir-v1.0.0-cqadupstack-wordpress.splade-pp-ed.splade-pp-ed-onnx.topics.beir-v1.0.0-cqadupstack-wordpress.test.txt

Effectiveness

With the above commands, you should be able to reproduce the following results:

nDCG@10 SPLADE++ (CoCondenser-EnsembleDistil)
BEIR (v1.0.0): CQADupStack-wordpress 0.2718
R@100 SPLADE++ (CoCondenser-EnsembleDistil)
BEIR (v1.0.0): CQADupStack-wordpress 0.5923
R@1000 SPLADE++ (CoCondenser-EnsembleDistil)
BEIR (v1.0.0): CQADupStack-wordpress 0.7924