RxnOptBench / docs /source_report_multiple_choice.md
songjhPKU's picture
Upload benchmark review release
bd355f0 verified

选择题评测集构建报告 (V6)

生成时间: 2026-05-02 00:01:11 输出目录: 20260502_000057_multiple_choice 题目总数: 3911

1. 先看什么

如果你是第一次接手这个输出目录,推荐按下面顺序阅读:

  1. 先读 report.md 当前节与后面的“文件导航 / 最小接入路径 / JSON 关键字段”。
  2. 再打开一个目标数据集 JSON,例如 multiple_choice_single_varying.json 看真实样本。
  3. 根据样本的 question_type 选择对应 prompt 文件。
  4. 参考 example_prediction_*.json 确认模型输出格式。
  5. 最后用 evaluate_multiple_choice.py 跑评测;如果要改构题或评分,再看脚本快照与 common_v6.py

2. 文件导航

你现在要做什么 优先读取哪些文件 为什么
快速理解这个目录 report.md 总览题型、字段、评测口径与命令
看真实输入样本 multiple_choice_*.json 真实 schema、meta 字段和题型差异都以这里为准
渲染题目给模型 prompt_*.txt + 对应数据集 JSON prompt 模板与样本字段需要一起看
对接模型输出格式 example_prediction_*.json 最快确认 id -> option_index 契约
运行评测 evaluate_multiple_choice.py 指标口径、合法预测规则与默认参数都在这里
修改选择题文案或 schema build_multiple_choice.py report、prompt、样本结构都由这里导出
修改条件解析、评分或 reference 抽样 common_v6.py 选择题与填空题共用 helper 在这里

3. 最小接入路径

把本目录当成自包含评测包使用即可:选择一个数据集 JSON,读取对应 prompt 模板渲染题目,生成 id -> option_index 的预测文件,再用 evaluate_multiple_choice.py 评分。

3.1 最短工作流

  1. 选一个数据集文件。
  2. 根据 question_type 读取对应 prompt 模板。
  3. 用样本里的 input 字段渲染 prompt。
  4. 让模型只输出一个 0-based 选项编号。
  5. 把所有结果保存成 prediction.json
  6. 运行 evaluate_multiple_choice.py --dataset ... --prediction prediction.json

4. 题型地图

question_type 你会看到什么 评测时要注意什么
single_varying 只让 1 个条件键变化;题面会给一个真实 fixed_conditions 所有选项都来自这组固定条件下真实出现过的组合;得分只在该局部选项集内计算
all_varying 一个选项代表一整组变化条件 评分直接在当前候选选项集内进行
single_varying_reference 单条件题,并额外给 reference 条件组 reference 来自题内选项之外的真实组合,不能高于该题局部最佳值
all_varying_reference 全条件题,并额外给 reference 条件组 去掉 reference 后的剩余选项才是可选答案空间
*_reference_control 与 reference 题配对的无 reference 对照题 用于对比 reference 信息是否有帮助,评分口径与对应非 control 题一致

4.1 单条件题的真实组合规则

  • single_varying 先在原表中枚举其它变化条件的真实固定组,选择对目标条件覆盖值最多的一组作为 fixed_conditions;只有该组里真实出现过的组合才会成为选项,最优答案和相对得分都只在这一局部真实选项集内计算。
  • single_varying_reference 的 reference 可来自组选项外的真实组合,但不能与任一选项+fixed_conditions 组合重合,且 effective 不能高于该题选项集内的最佳 effective。

5. 评分与评测

  • 主分数为 predicted_effective / option_set_best_effective。其中 effective = yield * enantio_major_fraction * dr_major_fraction * rr_major_fraction;对映选择性优先用 ee,ee 缺失时用 er;缺失 ee/er/dr/rr 时按 1.0 处理,不额外惩罚。
  • 主指标是 avg_relative_score,会对所有评测样本取均值。
  • exact_match_accuracy 用来看模型是否直接命中当前题目选项空间内的最优组。
  • avg_yield_ratio 用来看预测项产率相对当前题目最佳产率的接近程度。

6. 输出文件

6.1 数据集

文件 question_type 样本数
multiple_choice_single_varying.json single_varying 1039
multiple_choice_all_varying.json all_varying 552
multiple_choice_single_varying_reference.json single_varying_reference 850
multiple_choice_all_varying_reference.json all_varying_reference 310
multiple_choice_single_varying_reference_control.json single_varying_reference_control 850
multiple_choice_all_varying_reference_control.json all_varying_reference_control 310

6.2 Prompt

文件 对应题型 用途
prompt_single_varying.txt single_varying 渲染给模型的指令模板
prompt_all_varying.txt all_varying 渲染给模型的指令模板
prompt_single_varying_reference.txt single_varying_reference 渲染给模型的指令模板
prompt_all_varying_reference.txt all_varying_reference 渲染给模型的指令模板
prompt_single_varying.txt single_varying_reference_control 渲染给模型的指令模板
prompt_all_varying.txt all_varying_reference_control 渲染给模型的指令模板

6.3 示例预测

文件 对应数据集 用途
example_prediction_multiple_choice_single_varying.json multiple_choice_single_varying.json 用于快速验证预测 JSON 结构与评测链路
example_prediction_multiple_choice_all_varying.json multiple_choice_all_varying.json 用于快速验证预测 JSON 结构与评测链路
example_prediction_multiple_choice_single_varying_reference.json multiple_choice_single_varying_reference.json 用于快速验证预测 JSON 结构与评测链路
example_prediction_multiple_choice_all_varying_reference.json multiple_choice_all_varying_reference.json 用于快速验证预测 JSON 结构与评测链路
example_prediction_multiple_choice_single_varying_reference_control.json multiple_choice_single_varying_reference_control.json 用于快速验证预测 JSON 结构与评测链路
example_prediction_multiple_choice_all_varying_reference_control.json multiple_choice_all_varying_reference_control.json 用于快速验证预测 JSON 结构与评测链路

6.4 辅助文件

文件 作用 什么时候读
report.md 当前目录的总览与接入指南 第一次接手输出目录时先读
README.md testsetV6 根目录说明快照 想快速了解整个 V6 目录而不仅是本批输出时读
build_multiple_choice.py 选择题构建脚本快照 需要理解题目是怎么生成时读
evaluate_multiple_choice.py 选择题评测脚本 需要跑分、看指标口径时读
common_v6.py 共享解析与评分 helper 需要修改公共逻辑或核对评分时读

7. JSON 关键字段

7.1 顶层字段

字段 说明
id 题目唯一标识,格式为 {table_id}_q{N}[_ref][_ref_control]
question_type 题型标识,决定 prompt 模板和评分逻辑
target_key 被提问的单个条件键(仅 single_varying 系列),all_varying 系列为 null
varying_keys 题目中所有变化条件键列表
input 渲染 prompt 所需的全部信息(反应物、产物、固定条件、reference 等)
options 选项列表,每个元素是一组条件字典
answer 当前题目选项空间内的最优索引列表;并列最优时长度可大于 1,仅用于 exact-hit 诊断
meta 题目构建元信息,详见下方

7.2 input 子字段

字段 说明
input.reactants 反应物列表,每项含 content(名称)和 SMILES
input.products 产物列表,同上
input.constant_conditions 所有选项共享的不变条件
input.fixed_conditions 仅单条件题出现;表示题面固定住的真实条件组
input.reference_conditions *_reference 题出现;提供额外线索的参考条件组与结果

7.3 meta 子字段

字段 说明
meta.source_file 该题来源的原始 JSON 文件名
meta.doi 来源论文的 DOI
meta.best_yield 当前题目选项空间内的最佳产率
meta.best_effective_score 当前题目选项空间内的最佳 effective score(综合 yield、ee、dr 等)
meta.best_entry_indices 当前选项空间内最优条目在原表中的行索引
meta.global_best_yield 整张源表的全局最佳产率(可能高于当前选项集,仅供诊断)
meta.global_best_effective_score 整张源表的全局最佳 effective score
meta.global_best_entry_indices 整张源表全局最优条目的行索引
meta.total_entries_in_source_table 源表(原始 JSON 文件)中的总条目数,不是当前选项数
meta.yields options 对齐的各选项产率列表
meta.effective_scores options 对齐的各选项 effective score 列表
meta.scores options 对齐的各选项详细评分(yield/ee/dr/er/rr)
meta.option_relative_scores options 对齐的相对分数列表(最优=1.0),是主评测依据
meta.option_source_entries options 对齐的条目来源信息(row_index、entry_idx、rxn_id)
meta.parent_table_id 源表标识(通常为 root_img_name 或文件名去扩展名)
meta.main_product_smiles 用于评分的主产物 SMILES

8. 评测脚本

预测文件必须是 id -> 单个选项索引

{
  "sample_id_1": 2,
  "sample_id_2": 0
}
python evaluate_multiple_choice.py \
  --dataset multiple_choice_all_varying_reference.json \
  --prediction pred.json

9. Reference 规则

  • reference 条件数至少 2 条、至多 5 条。
  • 参考条件只从低到中等表现区间抽取,不暴露最高分条件。
  • 去掉 reference 后,剩余候选必须至少还有 5 个有效选项。
  • 仅当 reference 成功生成时,额外配对生成无 reference 的 *_reference_control 题。

10. 构建设置

设置项 当前值 说明
YEAR_FILTER None 论文发表年份筛选。None=不限;整数 N=仅 ≥N 年;列表=仅指定年份
CONDITION_KEYS None 提取的反应条件类别。None=自动发现所有条件键
CONDITION_REQUIRE content 条件项最低数据要求
SMILES_EXEMPT_KEYS ['solvents'] CONDITION_REQUIRE=smiles 时豁免 SMILES 要求的类别
REACTANT_PRODUCT_REQUIRE smiles 反应物/产物完整性(表级)
INPUT_PRODUCTS_MODE main_only 输入产物范围
YIELD_FIELD_PRIORITY ['isolated_yield', 'yield_ratio'] 产率字段解析优先级
EXPAND_CURRENT_CONDITIONS True 是否展开 current_conditions 子字段
CONDITION_KEYS_BLACKLIST ['indeterminate_mol_idt', 'description', 'indeterminate_descriptions', 'other_info', 'selected_conditions', 'scale'] 条件键黑名单
NORMALIZE_CONDITIONS True 条件文本比较时是否归一化
BALANCE_ALL_VARYING_OPTIONS False 是否对 all_varying 选项做均衡化
BALANCE_MAX_IMBALANCE_RATIO 1.5 均衡化目标上界
BALANCE_MIN_OPTIONS 4 均衡化保留的最少选项数
MIN_REFERENCE_OPTIONS 2 reference 模式下至少提供几个 reference 条件
MAX_REFERENCE_OPTIONS 5 reference 模式下最多提供几个 reference 条件
MIN_REFERENCE_REMAINING_EFFECTIVE_OPTIONS 5 仅 all_varying reference 使用,去掉 reference 后至少保留多少个有效选项
REFERENCE_LOW_MID_FRACTION 0.6666666666666666 reference 仅从低到中等表现区间抽取的比例

11. 统计摘要

  • table 文件总数: 911
  • 使用的表格数: 552
  • 生成题目总数: 3911
  • reference 尝试数: 1636
  • reference 生成数: 1193
  • reference 跳过原因: {'not_enough_effective_options': 242, 'not_enough_reference_candidates': 150, 'no_reference_candidate': 49, 'no_non_top_score_group': 2}
  • filter_is_table 淘汰: 0
  • filter_reactant_product_require 淘汰: 0
  • filter_same_reactants_products 淘汰: 0

12. 样本展示

single_varying 示例:10_1002_anie_202416132_si_5_table_0_q1

  • 反应物: 2,2-difluoro-3-phenyl-2H-indole (FC1(F)C(c2ccccc2)=Nc2ccccc21)
  • 产物: 2-fluoro-3-phenyl-1H-indole (Fc1c(-c2ccccc2)[nH]c2ccccc12)

不变条件:

  • Anode(+): Zn
  • Cathode(-): C
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • speed: 800 rpm

固定条件:

  • reaction_time: 4 h
  • 试剂 (reagents): PS-750-M
  • 溶剂 (solvents): water (O)

选项: Option 0:

  • Constant_Current: 30 mA

Option 1:

  • Constant_Current: 10 mA

最佳索引: [0] 相对分数: [1.0, 0.587629]

single_varying_reference 示例:10_1002_anie_202416132_si_5_table_0_q1_ref

  • 反应物: 2,2-difluoro-3-phenyl-2H-indole (FC1(F)C(c2ccccc2)=Nc2ccccc21)
  • 产物: 2-fluoro-3-phenyl-1H-indole (Fc1c(-c2ccccc2)[nH]c2ccccc12)

不变条件:

  • Anode(+): Zn
  • Cathode(-): C
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • speed: 800 rpm

固定条件:

  • reaction_time: 4 h
  • 试剂 (reagents): PS-750-M
  • 溶剂 (solvents): water (O)

Reference 条件: Reference 1 (yield=59.0%):

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 10 mA
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 18 h
  • 试剂 (reagents): —
  • 溶剂 (solvents): 3 wt % aq. PS-750-M
  • speed: 800 rpm

Reference 2 (yield=92.0%):

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 20 mA
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • 试剂 (reagents): PS-750-M
  • 溶剂 (solvents): —
  • speed: 800 rpm

选项: Option 0:

  • Constant_Current: 10 mA

Option 1:

  • Constant_Current: 30 mA

最佳索引: [1] 相对分数: [0.587629, 1.0]

single_varying_reference_control 示例:10_1002_anie_202416132_si_5_table_0_q1_ref_control

  • 反应物: 2,2-difluoro-3-phenyl-2H-indole (FC1(F)C(c2ccccc2)=Nc2ccccc21)
  • 产物: 2-fluoro-3-phenyl-1H-indole (Fc1c(-c2ccccc2)[nH]c2ccccc12)

不变条件:

  • Anode(+): Zn
  • Cathode(-): C
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • speed: 800 rpm

固定条件:

  • reaction_time: 4 h
  • 试剂 (reagents): PS-750-M
  • 溶剂 (solvents): water (O)

选项: Option 0:

  • Constant_Current: 30 mA

Option 1:

  • Constant_Current: 10 mA

最佳索引: [0] 相对分数: [1.0, 0.587629]

all_varying_reference 示例:10_1002_anie_202416132_si_4_table_1_q4_ref

  • 反应物: 2,2-difluoro-3-phenyl-2H-indole (FC1(F)C(c2ccccc2)=Nc2ccccc21)
  • 产物: 2-fluoro-3-phenyl-1H-indole (Fc1c(-c2ccccc2)[nH]c2ccccc12)

不变条件:

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 30 mA
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • speed: 800 rpm

Reference 条件: Reference 1 (yield=27.0%):

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 30 mA
  • Electrolyte: n-Bu4NClO4 (0.1 M)
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • 试剂 (reagents): n-Bu4NClO4 (CCCC[N+](CCCC)(CCCC)CCCC.[O-][Cl+3]([O-])([O-])[O-])
  • 溶剂 (solvents): 3 wt % aq. PS-750-M
  • speed: 800 rpm

Reference 2 (yield=32.0%):

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 30 mA
  • Electrolyte: NaI (0.1 M)
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • 试剂 (reagents): NaI ([I-].[Na+])
  • 溶剂 (solvents): PS-750-M
  • speed: 800 rpm

Reference 3 (yield=42.0%):

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 30 mA
  • Electrolyte: n-Bu4NBr (0.1 M)
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • 试剂 (reagents): n-Bu4NBr (CCCC[N+](CCCC)(CCCC)CCCC.[Br-])
  • 溶剂 (solvents): 3 wt % aq. PS-750-M
  • speed: 800 rpm

选项: Option 0:

  • Electrolyte: NaBF4 (0.1 M)
  • 试剂 (reagents): NaBF4 (F[B-](F)(F)F.[Na+])
  • 溶剂 (solvents): PS-750-M

Option 1:

  • Electrolyte: n-Bu4NPF6 (0.1 M)
  • 试剂 (reagents): n-Bu4NPF6 (CCCC[N+](CCCC)(CCCC)CCCC.F[P-](F)(F)(F)(F)F)
  • 溶剂 (solvents): PS-750-M

Option 2:

  • Electrolyte: n-Bu4NI (0.1 M)
  • 试剂 (reagents): n-Bu4NI (CCCC[N+](CCCC)(CCCC)CCCC.[I-])
  • 溶剂 (solvents): 3 wt % aq. PS-750-M

Option 3:

  • Electrolyte: NaBr (0.1 M)
  • 试剂 (reagents): NaBr ([Br-].[Na+])
  • 溶剂 (solvents): aq. PS-750-M

Option 4:

  • Electrolyte: NaClO4 (0.1 M)
  • 试剂 (reagents): NaClO4 ([Na+].[O-][Cl+3]([O-])([O-])[O-])
  • 溶剂 (solvents): PS-750-M

最佳索引: [2] 相对分数: [0.79661, 0.474576, 1.0, 0.677966, 0.762712]

all_varying_reference_control 示例:10_1002_anie_202416132_si_4_table_1_q4_ref_control

  • 反应物: 2,2-difluoro-3-phenyl-2H-indole (FC1(F)C(c2ccccc2)=Nc2ccccc21)
  • 产物: 2-fluoro-3-phenyl-1H-indole (Fc1c(-c2ccccc2)[nH]c2ccccc12)

不变条件:

  • Anode(+): Zn
  • Cathode(-): C
  • Constant_Current: 30 mA
  • Main_Mode: Constant
  • Reaction_Type: Integrated Cell Reaction
  • reaction_temperature: rt
  • reaction_time: 4 h
  • speed: 800 rpm

选项: Option 0:

  • Electrolyte: NaBr (0.1 M)
  • 试剂 (reagents): NaBr ([Br-].[Na+])
  • 溶剂 (solvents): aq. PS-750-M

Option 1:

  • Electrolyte: n-Bu4NPF6 (0.1 M)
  • 试剂 (reagents): n-Bu4NPF6 (CCCC[N+](CCCC)(CCCC)CCCC.F[P-](F)(F)(F)(F)F)
  • 溶剂 (solvents): PS-750-M

Option 2:

  • Electrolyte: NaClO4 (0.1 M)
  • 试剂 (reagents): NaClO4 ([Na+].[O-][Cl+3]([O-])([O-])[O-])
  • 溶剂 (solvents): PS-750-M

Option 3:

  • Electrolyte: NaBF4 (0.1 M)
  • 试剂 (reagents): NaBF4 (F[B-](F)(F)F.[Na+])
  • 溶剂 (solvents): PS-750-M

Option 4:

  • Electrolyte: n-Bu4NI (0.1 M)
  • 试剂 (reagents): n-Bu4NI (CCCC[N+](CCCC)(CCCC)CCCC.[I-])
  • 溶剂 (solvents): 3 wt % aq. PS-750-M

最佳索引: [4] 相对分数: [0.677966, 0.474576, 0.762712, 0.79661, 1.0]