Views
No views yet
pip install inranker1from inranker import T5Ranker
2
3model = T5Ranker(model_name_or_path="unicamp-dl/InRanker-base")
4
5docs = [
6 "The capital of France is Paris",
7 "Learn deep learning with InRanker and transformers"
8]
9scores = model.get_scores(
10 query="What is the best way to learn deep learning?",
11 docs=docs
12)
13# Scores are sorted in descending order (most relevant to least)
14# scores -> [0, 1]
15sorted_scores = sorted(zip(scores, docs), key=lambda x: x[0], reverse=True)@misc{laitz2024inranker,
title={InRanker: Distilled Rankers for Zero-shot Information Retrieval},
author={Thiago Laitz and Konstantinos Papakostas and Roberto Lotufo and Rodrigo Nogueira},
year={2024},
eprint={2401.06910},
archivePrefix={arXiv},
primaryClass={cs.IR}
}