Nexevo.aiNexevo.ai
← Semua contoh
RAG / Capaian

Rerank mula pantas

50 calon → top-5 disusun.

python
from nexevo_ai import Nexevo
client = Nexevo()

# 把 embedding 召回的 top-50 候选,按相关性精排留 top-5
ranked = client.rerank.create(
    model="rerank-v3.5",                 # Cohere v3.5 — 英文 RAG 标杆
    query="如何重置员工 VPN?",
    documents=[
        "VPN 服务器列表请联系 IT 支持...",
        "重置 VPN 密码需要登录员工门户...",
        "公司 WiFi 配置在员工手册第 3 章...",
        # ... 候选 50 条
    ],
    top_n=5,
)
for r in ranked["results"]:
    print(f"score={r['relevance_score']:.3f}  doc={r['document'][:60]}")
Rerank mula pantas — Nexevo Cookbook | Nexevo.ai