BGE Reranker M3
A strong reranker model for ordering query results.
Deploy BGE Reranker M3 behind an API endpoint in seconds.
Example usage
BAAI/bge-reranker-v2-m3
is a reranker model, used to re-rank a list of items, given a query.
It is frequently used in search engines, recommendation systems, and more.
Input
1import requests
2import os
3
4headers = {
5 f"Authorization": f"Api-Key {os.environ['BASETEN_API_KEY']}"
6}
7
8requests.post(
9 headers=headers,
10 url="https://model-xxxxxx.api.baseten.co/environments/production/sync/rerank",
11 json={
12 "query": "What is Baseten?",
13 "raw_scores": True,
14 "return_text": False,
15 "texts": [
16 "Deep Learning is ...", "Baseten is a fast inference provider"
17 ],
18 "truncate": True,
19 "truncation_direction": "Right"
20 }
21)
JSON output
1[
2 {
3 "index": 0,
4 "score": 1,
5 "text": "Deep Learning is ..."
6 }
7]