Add XTR retriever with token-level scoring and imputation#197
Closed
robro612 wants to merge 2 commits intolightonai:mainfrom
Closed
Add XTR retriever with token-level scoring and imputation#197robro612 wants to merge 2 commits intolightonai:mainfrom
robro612 wants to merge 2 commits intolightonai:mainfrom
Conversation
Collaborator
|
Hi @robro612, same question here, would it be possible to have a small benchmark with ndcg@10 and qps ? |
…(non-plaid). This supports multiple imputation functions: min (default), zero, mean, percentile, or power_law. Although min is default and highly suggested.
- Fix broken doctest in xtr.py (missing add_documents call) - Fix progress bar total using ceil division - Use torch.isinf for robust missing-score detection in score_xtr - Rename misleading variable neg_b -> slope in power-law imputation - Export Base from indexes.__init__ and use public API in colbert.py - Add unit tests for _compute_imputation_scores (rectangular, ragged, edge cases) - Add beir_dataset_xtr.py eval script supporting both ColBERT and XTR retrieval - Fix test_xtr_retriever.py: name -> index_name kwarg for ScaNN
Contributor
Author
|
Updated some stuff to hopefully head off some minor feedback. Still depending on the prefix token logic landing before I can test it proper. I added the extra beir_xtr example but will remove it in the final commit for this. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
retrieve.XTRclass for XTR retrieval on non-PLAID indexes (e.g. ScaNN)score_xtr()scoring function with multiple imputation strategies (min,zero,mean,percentile,power_law)torch.unique()for string doc IDs, bulk.tolist()conversion,is_rectangularhint for imputationscore_xtrfrompylate.rankandXTRfrompylate.retrieveexamples/evaluation/beir_dataset.pyto support XTR retrieval and configurable model/index optionstest_xtr_scoring.py) and retriever (test_xtr_retriever.py)Depends on #195 and #196
Test plan
python -m pytest tests/test_xtr_scoring.py -vpython -m pytest tests/test_xtr_retriever.py -vpython examples/evaluation/beir_dataset.py --model_name robro612/xtr-base-en-pylate --index_type scann --retrieval_type xtr --dataset_name nfcorpus --do_encode_and_index— nDCG@10 should be ~33.1