Views
No views yet
Qwen/Qwen3-Reranker-0.6B
为基座,通过固定的 Qwen3-Reranker-4B 教师模型蒸馏得到,用于把已经召回的候选合同上下文
按“是否为准确、完整回答问题所直接需要”重新排序。yes_logit - no_logit margin,数值越大表示候选越应排在前面;1from sentence_transformers import CrossEncoder
2
3instruction = (
4 "Given a FIDIC contract question, determine whether the candidate bilingual "
5 "contract context is directly necessary to answer the question accurately and "
6 "completely. Prioritize directly applicable contractual rights, obligations, "
7 "procedures, conditions, time limits, valuations, payments, remedies, claims, "
8 "determinations, and dispute steps. Do not reward merely topical, adjacent, "
9 "or background similarity."
10)
11
12model = CrossEncoder(
13 "Qwen/Qwen3-Reranker-0.6B",
14 max_length=8192,
15 trust_remote_code=True,
16 prompts={"fidic_direct_context_v1": instruction},
17 default_prompt_name="fidic_direct_context_v1",
18)
19model.load_adapter(
20 "liweichao0719/reranker-lora-0.6B",
21 adapter_name="fidic_distilled_v1",
22)
23model.set_adapter("fidic_distilled_v1")
24
25pairs = [
26 ("承包商提出工期索赔时应遵守什么通知期限?", "候选合同上下文……"),
27]
28scores = model.predict(pairs)
29print(scores)e61197ed45024b0ed8a2d74b80b4d909f1255473、sentence-transformers==5.5.1、
transformers==5.6.0 与 peft==0.19.0。部署时应保持上述 instruction 和输入格式不变。yes-no margin;r=16、alpha=32、dropout=0.05;needed 字段或正式测试集。metrics.json。| 数据 | 模型 | Macro Direct R@10 | Micro Direct R@10 | Complete@10 | MRR |
|---|---|---|---|---|---|
| 开发集 220 题 | 原始 0.6B | 81.998% | 74.603% | 60.45% | 0.8021 |
| 开发集 220 题 | 蒸馏 0.6B | 84.358% | 78.660% | 64.55% | 0.8719 |
| 开发集 220 题 | 教师 4B | 86.339% | 79.894% | 67.27% | 0.8727 |
| 冻结测试集 220 题 | 原始 0.6B | 90.644% | 88.649% | 83.18% | 0.7669 |
| 冻结测试集 220 题 | 蒸馏 0.6B | 92.765% | 91.351% | 87.27% | 0.8326 |
| 冻结测试集 220 题 | 教师 4B | 93.409% | 91.892% | 87.27% | 0.8320 |