AnswerDotAI / AnswerDotAI/RAGatouille
Inconsistent search results length for high top-k values
- Dominant language
- Python
- Stars
- 4k
- Forks
- 276
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm getting an issue similar to #130. The number of returned top-k isn't always as specified (i.e. k=500, len(res) = 4xx, 3xx), this is more the case for the fine-tuned version of colbert-v2.
Tho it's uncommon to have such a high top-k, this is helpful for me when benchmarking and making the function more predictable when used.
- The dataset has 800 docs.
- Model: fine-tuned colbert-ir/colbertv2.0.
Code:
```py
from ragatouille import RAGPretrainedModel
# Indexing
RAG = RAGPretrainedModel.from_pretrained("/path/to/finetuned_model")
index_path = RAG.index(index_name="my_index", collection=docs, document_ids=doc_ids)
# Retrieving
RAG = RAGPretrainedModel.from_index('.ragatouille/colbert/indexes/finetuned_index')
results = RAG.search(query, k=500)
print(len(results))
# -> 500, 491, 413, 3xx, ....
```
Thanks for the help!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with the supplied RAGPretrainedModel indexing and search example, using an 800-document dataset and k=500. Trace the retrieval path used by search for the fine-tuned index and compare the requested k with the returned result count. Done means the behavior is explained and the result count is predictable when enough documents are indexed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100