feat: thread and persist sub_pattern into accepted questions
This commit is contained in:
@@ -251,6 +251,7 @@ def _to_generated_question(
|
||||
family: str,
|
||||
options: tuple[str, ...] | None = None,
|
||||
answer: str | None = None,
|
||||
sub_pattern: str | None = None,
|
||||
) -> GeneratedQuestion:
|
||||
"""将 CandidateQuestion 转换为 GeneratedQuestion。
|
||||
|
||||
@@ -259,6 +260,7 @@ def _to_generated_question(
|
||||
family: 问题家族名称(如 "RETRIEVAL")。
|
||||
options: 洗牌后的选项元组(若为 None 则使用 candidate 原始选项)。
|
||||
answer: 重映射后的答案字母(若为 None 则使用 candidate 原始答案)。
|
||||
sub_pattern: 出题子模式标识(AR 特化策略使用,None 表示无)。
|
||||
|
||||
返回:
|
||||
GeneratedQuestion 实例(difficulty_steps 初始为 None)。
|
||||
@@ -275,6 +277,7 @@ def _to_generated_question(
|
||||
family=family,
|
||||
skill_target=candidate.skill_target,
|
||||
difficulty_steps=None,
|
||||
sub_pattern=sub_pattern,
|
||||
)
|
||||
|
||||
|
||||
@@ -531,6 +534,7 @@ async def _process_one_slot(
|
||||
family=strategy.strategy_name,
|
||||
options=pp.options,
|
||||
answer=pp.answer,
|
||||
sub_pattern=sub_pattern.name if sub_pattern else None,
|
||||
)
|
||||
# 将题目 embedding 加入池(flatten 确保 1D)
|
||||
embed_pool.append(embed_fn(candidate.question).flatten())
|
||||
|
||||
Reference in New Issue
Block a user