curl -X POST "https://api.lemondata.cc/v1/rerank" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "BAAI/bge-reranker-v2-m3", "query": "What is machine learning?", "documents": [ "Machine learning is a subset of AI", "The weather is nice today", "Deep learning uses neural networks" ], "top_n": 2, "return_documents": true }'
{ "results": [ { "index": 0, "relevance_score": 0.95, "document": "Machine learning is a subset of AI" }, { "index": 2, "relevance_score": 0.82, "document": "Deep learning uses neural networks" } ], "model": "BAAI/bge-reranker-v2-m3", "usage": { "prompt_tokens": 45, "total_tokens": 45 } }
クエリに対する関連性に基づいてドキュメントを再ランク付けします
BAAI/bge-reranker-v2-m3
qwen3-rerank
index
relevance_score
document
return_documents=true
使用するリランカーモデルの ID(例: BAAI/bge-reranker-v2-m3 、 qwen3-rerank )。
ドキュメントをランク付けするためのクエリ。
再ランク付けするドキュメント(文字列)のリスト。
返却する上位結果の数。デフォルトはすべてのドキュメントです。
レスポンスに元のドキュメントテキストを含めるかどうか。
Response 200
スコア順にランク付けされたドキュメントのリスト。 各結果には以下が含まれます: index (integer): 元のドキュメントのインデックス relevance_score (number): 関連性スコア (0-1) document (string): 元のテキスト( return_documents=true の場合)
再ランク付けに使用されたモデル。
トークン使用統計。