Views
No views yet
1from sentence_transformers.cross_encoder import CrossEncoder
2
3model = CrossEncoder('yjoonjang/preranker-v1')
4model.eval()
5pairs = [
6 ["Is 'https://www.apple.com' available in the Wayback Machine on September 9, 2015?", "{'name': 'availability', 'description': 'Checks if a given URL is archived and currently accessible in the Wayback Machine.', 'parameters': {'url': {'description': 'The URL to check for availability in the Wayback Machine.', 'type': 'str', 'default': 'http://mashape.com'}, 'timestamp': {'description': \"The timestamp to look up in Wayback. If not specified, the most recent available capture is returned. The format of the timestamp is 1-14 digits (YYYYMMDDhhmmss). Defaults to '20090101'.\", 'type': 'str, optional', 'default': '20090101'}, 'callback': {'description': 'An optional callback to produce a JSONP response. Defaults to None.', 'type': 'str, optional', 'default': ''}}}"],
7 ["Is 'https://www.apple.com' available in the Wayback Machine on September 9, 2015?", "{'name': 'top_grossing_mac_apps', 'description': 'Fetches a list of the top-grossing Mac apps from the App Store.', 'parameters': {'category': {'description': \"The category ID for the apps to be fetched. Defaults to '6016' (general category).\", 'type': 'str', 'default': '6016'}, 'country': {'description': \"The country code for the App Store. Defaults to 'us'.\", 'type': 'str', 'default': 'us'}, 'lang': {'description': \"The language code for the results. Defaults to 'en'.\", 'type': 'str', 'default': 'en'}, 'num': {'description': 'The number of results to return. Defaults to 100. Maximum allowed value is 200.', 'type': 'int', 'default': '100'}}}"],
8 ["Is 'https://www.apple.com' available in the Wayback Machine on September 9, 2015?", "{'name': 'top_paid_mac_apps', 'description': 'Retrieves a list of the top paid Mac apps from the App Store.', 'parameters': {'category': {'description': \"Category of the apps to retrieve. Default is '6016'.\", 'type': 'str', 'default': '6016'}, 'country': {'description': \"Country code to filter the app results. Default is 'us'.\", 'type': 'str', 'default': 'us'}, 'lang': {'description': \"Language code for the results. Default is 'en'.\", 'type': 'str', 'default': 'en'}, 'num': {'description': 'Number of results to return. Default is 100. Maximum is 200.', 'type': 'int', 'default': '100'}}}",]
9]
10
11scores = model.predict(pairs)
12print(scores) # [0.91427845 0.7625548 0.7656321]make_toolret_to_beir_format.ipynb for more details.1git clone https://github.com/yjoonjang/PreRanker.git
2cd PreRanker/toolret_eval
3python run_mteb.py| Model Name | Model Parameter | Recall@10 | MAP@10 | MRR@10 | Precision@10 | NDCG@10 |
|---|---|---|---|---|---|---|
| yjoonjang/preranker-v1 | 150M | 0.540 | 0.361 | 0.462 | 0.088 | 0.428 |
| Alibaba-NLP/gte-reranker-modernbert-base | 150M | 0.524 | 0.356 | 0.454 | 0.086 | 0.422 |
| jinaai/jina-reranker-v2-base-multilingual | 278M | 0.502 | 0.331 | 0.414 | 0.083 | 0.395 |
| Alibaba-NLP/gte-multilingual-reranker-base | 306M | 0.474 | 0.299 | 0.383 | 0.078 | 0.363 |
| BAAI/bge-reranker-v2-m3 | 568M | 0.461 | 0.293 | 0.370 | 0.076 | 0.355 |
apache-2.01@misc{Pre:Ranker,
2 publisher = {Youngjoon Jang, Seongtae Hong},
3 year = {2025},
4 url = {https://github.com/yjoonjang/preranker}
5},1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@inproceedings{cao2007learning,
2 title={Learning to Rank: From Pairwise Approach to Listwise Approach},
3 author={Cao, Zhe and Qin, Tao and Liu, Tie-Yan and Tsai, Ming-Feng and Li, Hang},
4 booktitle={Proceedings of the 24th international conference on Machine learning},
5 pages={129--136},
6 year={2007}
7}