From 4dc0d2259a2b63369a8942db88ee49b4f55431cc Mon Sep 17 00:00:00 2001 From: xiaoyan-bot Date: Thu, 9 Apr 2026 17:49:51 +0800 Subject: [PATCH] auto-sync: listening-choicePic 2026-04-09_17:49 --- SKILL.md | 71 ++++++++++ references/ability_tags.md | 28 ++++ references/difficulty_mapping.md | 15 ++ references/l1_word_list.json | 1 + scripts/generate_listening_choicePic.py | 178 ++++++++++++++++++++++++ 5 files changed, 293 insertions(+) create mode 100644 SKILL.md create mode 100644 references/ability_tags.md create mode 100644 references/difficulty_mapping.md create mode 100644 references/l1_word_list.json create mode 100755 scripts/generate_listening_choicePic.py diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..385ddba --- /dev/null +++ b/SKILL.md @@ -0,0 +1,71 @@ +--- +name: listening-choicePic +description: K12英语听力三选一图片选择题标准化设计、生产、审校工具。对应题型:L1 - Starters - 听力 Part3 三选一图片选择,考察核心能力:显性事实理解(单句信息点抓取)。使用场景:(1) 根据给定知识点、难度等级生成符合教研规范的听力三选一题目;(2) 校验题目格式、难度匹配、内容合规性;(3) 批量生产听力三选一题目。触发关键词:听力三选一、图片选择题、listening choice pic、听力Part3三选一、单句信息点抓取题 +--- +# Listening ChoicePic 听力三选一图片选择题生产技能 +## 题型说明 +本技能对应官方题型:**L1 - Starters - 听力 Part3 三选一图片选择**,考察核心能力为**显性事实理解(单句信息点抓取)**:学生听单句听力内容,从3张图片选项中选出与听力内容匹配的正确答案。 +## 难度对应关系(与教研标准对齐) +| 难度等级 | 对应L1阶段 | 对应剑桥考试等级 | 难度描述 | +|----------|------------|------------------|----------| +| A级 | L1 第1-2阶段 | Starters 1-2 | 选项差异极大(类别完全不同),听力为3-5词简单句,关键词后置 | +| B级 | L1 第3-4阶段 | Starters 3 | 选项为同类物品差异(颜色/大小不同),听力为5-8词简单句 | +| C级 | L1 第5-6阶段 | Movers 1 | 选项为动作/状态差异,听力为8-12词带介词短语的句子 | +| D级 | L2 第1-2阶段 | Movers 2-3 | 选项为场景/逻辑差异,听力为12-15词带简单从句的句子 | +## 能力标签绑定规则 +1. 题型固定绑定通用能力标签:听力理解、图片信息识别、单句信息抓取 +2. 每道题专属能力标签(与官方45个能力tag对齐): + - 所有题目统一绑定:**显性事实理解(单句信息点抓取)** +3. 生产时自动标注每道题考察的核心知识点 +## 生产规则 +1. 每道题包含:1段听力文本(单句,符合难度要求)、3张图片选项(1个正确,2个干扰) +2. 干扰项设置规则: + - A级:干扰项与正确选项类别完全不同(如:猫vs书vs苹果) + - B级:干扰项与正确选项为同类别不同属性(如:红苹果vs绿苹果vs黄苹果) + - C级:干扰项与正确选项为同物品不同动作/状态(如:吃苹果vs洗苹果vs切苹果) + - D级:干扰项与正确选项为同场景不同逻辑(如:男孩拿苹果vs女孩拿苹果vs男孩拿橘子) +3. 听力文本要求:自然日常,可使用陈述句、疑问句、祈使句等多种句式,避免生硬表达 +4. 图片描述要求:清晰标注3张图片的核心差异点,便于图片生产 +## 输入参数 +| 参数 | 必填 | 格式示例 | 说明 | +|------|------|----------|------| +| 知识点 | ✅ | `apple n.苹果;red adj.红色;eat v.吃` | 考察的核心知识点列表 | +| 难度等级 | ✅ | `A级` / `L1第2阶段` / `Starters 2` | 难度等级或对应阶段 | +| 题量 | 🟢 | `5` | 生成题目数量,默认1道 | +| 场景要求 | 🟢 | `场景为家庭厨房` | 指定题目场景,不指定则自动匹配知识点 | +## 输出格式规范 +严格按照以下格式输出,禁止额外内容: +``` +【题目组描述】 +[整体场景说明,例如:听句子,选出与你听到的内容相符的图片] +--- +【题目1】 +【听力文本】 +[角色]: [符合难度的单句听力内容] +【图片描述】 +A: [图片A核心特征描述] +B: [图片B核心特征描述] +C: [图片C核心特征描述] +【正确答案】 +[正确选项字母,例如:A] +【能力项】 +题目1 - 显性事实理解(单句信息点抓取)- [考察核心知识点,例如:red apple] +--- +【题目2】 +...(多题重复上述结构) +``` +## 校验规则 +自动校验不通过直接返回错误: +1. 词汇校验:所有知识点必须在L1单词库中,禁止超纲 +2. 格式校验:缺少必填字段或格式不符合规范 +3. 难度校验:听力句子长度、词汇难度不符合对应等级要求 +4. 逻辑校验:干扰项设置不符合对应难度的差异要求 +## 脚本使用说明 +执行`scripts/generate_listening_choicePic.py`完成自动化生产: +```bash +python scripts/generate_listening_choicePic.py \ + --knowledge "apple n.苹果;red adj.红色;eat v.吃" \ + --difficulty "A" \ + --count 3 \ + --scene "家庭场景" +``` diff --git a/references/ability_tags.md b/references/ability_tags.md new file mode 100644 index 0000000..48fedab --- /dev/null +++ b/references/ability_tags.md @@ -0,0 +1,28 @@ +# 听力三选一图片选择题能力标签对应表 +## 题型所属分类 +听力三选一图片选择题 = L1 - Starters - 听力 Part3 三选一图片选择 +## 题型固定绑定核心能力标签(与45个能力tag一一对应) +| 能力标签ID(预留) | 能力标签名称 | 能力描述 | +|--------------------|--------------|----------| +| TAG_LISTEN_008 | 显性事实理解 | 单句信息点抓取,直接从听力中提取核心信息 | +| TAG_LISTEN_009 | 图片信息识别 | 识别图片中的核心特征、物品、动作 | +| TAG_LISTEN_010 | 信息匹配能力 | 匹配听觉信息与视觉图片信息 | +## 题目专属能力标签 +每道题统一绑定:**显性事实理解(单句信息点抓取)**,自动标注对应考察的核心知识点。 +--- +## 全题型能力标签映射参考表(官方统一) +| 题型分类 | 能力标签 | +|----------|----------| +| L1 - Starters - 听力 Part1 图片连线 | 显性事实理解(关键词识别);基础语境理解(场景/物品/动作识别) | +| L1 - Starters - 听力 Part2 信息填写 | 显性细节理解(数字/时间/地点) | +| L1 - Starters - 听力 Part3 三选一图片选择(本技能对应题型) | 显性事实理解(单句信息点抓取) | +| L1 - Starters - 听力 Part4 涂色+位置 | 显性事实理解(关键词识别) | +| L1 - Movers - 听力 Part1 人物匹配 | 基础语境理解(场景/物品/动作识别) | +| L1 - Movers - 听力 Part2 表格填写 | 显性细节理解(数字/时间/地点);干扰抑制(多信息筛选) | +| L1 - Movers - 听力 Part3 星期活动匹配 | 目的/偏好识别(显性to/for/like) | +| L1 - Movers - 听力 Part4 三选一 | 同义替换识别(词/短语级);目的/偏好识别(显性to/for/like) | +| L1 - Movers(高阶) - 听力 Flyers Part2 表格填写 | 干扰抑制(多信息筛选) | +| L1 - Movers(高阶) - 听力 Flyers Part3 长对话选择 | 多句保持(信息整合) | +| L1 - Movers(高阶) - 听力 Flyers Part4 三选一 | 语用推断(否定与纠错) | +| L1 - Movers(高阶) - 听力 Flyers Part5 信息匹配 | 目的/偏好识别(显性to/for/like) | +| L1 - Movers(高阶) - 听力 KET Part3 长对话选择 | 情绪/态度理解 | diff --git a/references/difficulty_mapping.md b/references/difficulty_mapping.md new file mode 100644 index 0000000..e9d1edb --- /dev/null +++ b/references/difficulty_mapping.md @@ -0,0 +1,15 @@ +# 听力三选一图片选择题难度对应表 +## 难度等级与L1阶段、剑桥考试对应关系 +| 难度等级 | 对应L1阶段 | 对应剑桥考试等级 | 适用学生水平 | +|----------|------------|------------------|--------------| +| A级 | L1 第1-2阶段 | Starters 1-2 | 入门级,接触英语1-2个月 | +| B级 | L1 第3-4阶段 | Starters 3 | 入门级,接触英语3-4个月 | +| C级 | L1 第5-6阶段 | Movers 1 | 进阶级,接触英语5-6个月 | +| D级 | L2 第1-2阶段 | Movers 2-3 | 进阶级,接触英语7-8个月 | +## 各难度生产约束规则 +| 难度等级 | 单句最大单词数 | 词汇范围限制 | 干扰项差异要求 | +|----------|----------------|--------------|----------------| +| A级 | ≤5个单词 | 仅允许L1第1-2单元大纲词汇 | 选项类别完全不同(如:动物vs食物vs文具) | +| B级 | ≤8个单词 | 仅允许L1第3-4单元大纲词汇 | 同类别不同属性(如:红苹果vs绿苹果vs黄苹果) | +| C级 | ≤12个单词 | 允许L1全阶段大纲词汇 | 同物品不同动作/状态(如:吃苹果vs洗苹果vs切苹果) | +| D级 | ≤15个单词 | 允许L1+L2前2单元大纲词汇 | 同场景不同逻辑(如:男孩拿苹果vs女孩拿苹果vs男孩拿橘子) | diff --git a/references/l1_word_list.json b/references/l1_word_list.json new file mode 100644 index 0000000..bb68948 --- /dev/null +++ b/references/l1_word_list.json @@ -0,0 +1 @@ +{"update_time": "2026-03-26", "total_count": 980, "words": [{"word": "red", "pos": "adj", "meaning": "红色的", "level": "LV1(上)", "unit": "S0-U0-L1", "difficulty": 1, "enabled": true}, {"word": "hat", "pos": "n", "meaning": "帽子", "level": "LV1(上)", "unit": "S0-U0-L1", "difficulty": 1, "enabled": true}, {"word": "blue", "pos": "adj", "meaning": "蓝的", "level": "LV1(上)", "unit": "S0-U0-L1", "difficulty": 1, "enabled": true}, {"word": "bag", "pos": "n", "meaning": "袋,包", "level": "LV1(上)", "unit": "S0-U0-L1", "difficulty": 1, "enabled": true}, {"word": "orange", "pos": "adj", "meaning": "橙色的", "level": "LV1(上)", "unit": "S0-U0-L3", "difficulty": 1, "enabled": true}, {"word": "green", "pos": "adj", "meaning": "绿色的", "level": "LV1(上)", "unit": "S0-U0-L2", "difficulty": 1, "enabled": true}, {"word": "dress", "pos": "n", "meaning": "连衣裙", "level": "LV1(上)", "unit": "S0-U0-L2", "difficulty": 1, "enabled": true}, {"word": "there", "pos": "adv", "meaning": "那里", "level": "LV1(上)", "unit": "S0-U0-L3", "difficulty": 1, "enabled": true}, {"word": "put", "pos": "v", "meaning": "放", "level": "LV1(上)", "unit": "S0-U0-L3", "difficulty": 1, "enabled": true}, {"word": "purple", "pos": "adj", "meaning": "紫色的", "level": "LV1(上)", "unit": "S0-U0-L5", "difficulty": 1, "enabled": true}, {"word": "give", "pos": "v", "meaning": "给", "level": "LV1(上)", "unit": "S0-U0-L3", "difficulty": 1, "enabled": true}, {"word": "water", "pos": "n", "meaning": "水", "level": "LV1(上)", "unit": "S0-U0-L4", "difficulty": 1, "enabled": true}, {"word": "here", "pos": "adv", "meaning": "在这里", "level": "LV1(上)", "unit": "S0-U0-L4", "difficulty": 1, "enabled": true}, {"word": "dirty", "pos": "adj", "meaning": "肮脏的", "level": "LV1(上)", "unit": "S0-U0-L4", "difficulty": 1, "enabled": true}, {"word": "clean", "pos": "v", "meaning": "清洁", "level": "LV1(上)", "unit": "S0-U0-L4", "difficulty": 1, "enabled": true}, {"word": "pink", "pos": "adj", "meaning": "粉红色的", "level": "LV1(上)", "unit": "S0-U0-L2", "difficulty": 1, "enabled": true}, {"word": "get", "pos": "v", "meaning": "收到", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "wall", "pos": "n", "meaning": "墙", "level": "LV1(上)", "unit": "S1-U1-L1", "difficulty": 1, "enabled": true}, {"word": "table", "pos": "n", "meaning": "桌子", "level": "LV1(上)", "unit": "S1-U1-L1", "difficulty": 1, "enabled": true}, {"word": "floor", "pos": "n", "meaning": "地板", "level": "LV1(上)", "unit": "S1-U1-L1", "difficulty": 1, "enabled": true}, {"word": "hand", "pos": "n", "meaning": "手", "level": "LV1(上)", "unit": "S1-U1-L2", "difficulty": 1, "enabled": true}, {"word": "foot", "pos": "n", "meaning": "脚", "level": "LV1(上)", "unit": "S1-U1-L2", "difficulty": 1, "enabled": true}, {"word": "black", "pos": "adj", "meaning": "黑的", "level": "LV1(上)", "unit": "S1-U1-L2", "difficulty": 1, "enabled": true}, {"word": "tomato", "pos": "n", "meaning": "西红柿", "level": "LV1(上)", "unit": "S1-U1-L3", "difficulty": 1, "enabled": true}, {"word": "fish", "pos": "n", "meaning": "鱼", "level": "LV1(上)", "unit": "S1-U1-L3", "difficulty": 1, "enabled": true}, {"word": "chicken", "pos": "n", "meaning": "鸡肉", "level": "LV1(上)", "unit": "S1-U1-L3", "difficulty": 1, "enabled": true}, {"word": "nose", "pos": "n", "meaning": "鼻子", "level": "LV1(上)", "unit": "S1-U1-L4", "difficulty": 1, "enabled": true}, {"word": "eye", "pos": "n", "meaning": "眼睛", "level": "LV1(上)", "unit": "S1-U1-L4", "difficulty": 1, "enabled": true}, {"word": "brown", "pos": "adj", "meaning": "棕色的", "level": "LV1(上)", "unit": "S1-U1-L4", "difficulty": 1, "enabled": true}, {"word": "yellow", "pos": "adj", "meaning": "黄色的", "level": "LV1(上)", "unit": "S1-U1-L5", "difficulty": 1, "enabled": true}, {"word": "white", "pos": "adj", "meaning": "白色的", "level": "LV1(上)", "unit": "S1-U1-L5", "difficulty": 1, "enabled": true}, {"word": "go", "pos": "v", "meaning": "去,走", "level": "LV1(上)", "unit": "S1-U2-L1", "difficulty": 1, "enabled": true}, {"word": "dog", "pos": "n", "meaning": "狗", "level": "LV1(上)", "unit": "S1-U2-L1", "difficulty": 1, "enabled": true}, {"word": "come", "pos": "v", "meaning": "来", "level": "LV1(上)", "unit": "S1-U2-L1", "difficulty": 1, "enabled": true}, {"word": "cat", "pos": "n", "meaning": "猫", "level": "LV1(上)", "unit": "S1-U2-L1", "difficulty": 1, "enabled": true}, {"word": "pie", "pos": "n", "meaning": "馅饼", "level": "LV1(上)", "unit": "S1-U2-L2", "difficulty": 1, "enabled": true}, {"word": "can", "pos": "v", "meaning": "能,会", "level": "LV1(上)", "unit": "S1-U2-L4", "difficulty": 1, "enabled": true}, {"word": "open", "pos": "v", "meaning": "打开", "level": "LV1(上)", "unit": "S1-U2-L5", "difficulty": 1, "enabled": true}, {"word": "happy", "pos": "adj", "meaning": "快乐的", "level": "LV1(上)", "unit": "S1-U2-L5", "difficulty": 1, "enabled": true}, {"word": "see", "pos": "v", "meaning": "看见", "level": "LV1(上)", "unit": "S1-U3-L1", "difficulty": 1, "enabled": true}, {"word": "1", "pos": "num", "meaning": "1", "level": "LV1(上)", "unit": "S1-U3-L1", "difficulty": 1, "enabled": true}, {"word": "paper", "pos": "n", "meaning": "纸", "level": "LV1(上)", "unit": "S1-U3-L2", "difficulty": 1, "enabled": true}, {"word": "book", "pos": "n", "meaning": "书", "level": "LV1(上)", "unit": "S1-U3-L2", "difficulty": 1, "enabled": true}, {"word": "3", "pos": "num", "meaning": "3", "level": "LV1(上)", "unit": "S1-U3-L2", "difficulty": 1, "enabled": true}, {"word": "2", "pos": "num", "meaning": "2", "level": "LV1(上)", "unit": "S1-U3-L2", "difficulty": 1, "enabled": true}, {"word": "pen", "pos": "n", "meaning": "钢笔", "level": "LV1(上)", "unit": "S1-U3-L3", "difficulty": 1, "enabled": true}, {"word": "box", "pos": "n", "meaning": "盒子", "level": "LV1(上)", "unit": "S1-U3-L3", "difficulty": 1, "enabled": true}, {"word": "4", "pos": "num", "meaning": "4", "level": "LV1(上)", "unit": "S1-U3-L3", "difficulty": 1, "enabled": true}, {"word": "6", "pos": "num", "meaning": "6", "level": "LV1(上)", "unit": "S1-U3-L4", "difficulty": 1, "enabled": true}, {"word": "5", "pos": "num", "meaning": "5", "level": "LV1(上)", "unit": "S1-U3-L4", "difficulty": 1, "enabled": true}, {"word": "sing", "pos": "v", "meaning": "唱", "level": "LV1(上)", "unit": "S1-U4-L1", "difficulty": 1, "enabled": true}, {"word": "eat", "pos": "v", "meaning": "吃", "level": "LV1(上)", "unit": "S1-U4-L2", "difficulty": 1, "enabled": true}, {"word": "7", "pos": "num", "meaning": "7", "level": "LV1(上)", "unit": "S1-U4-L2", "difficulty": 1, "enabled": true}, {"word": "rug", "pos": "n", "meaning": "小地毯", "level": "LV1(上)", "unit": "S1-U4-L3", "difficulty": 1, "enabled": true}, {"word": "door", "pos": "n", "meaning": " 门", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "bed", "pos": "n", "meaning": "床", "level": "LV1(上)", "unit": "S1-U4-L3", "difficulty": 1, "enabled": true}, {"word": "9", "pos": "num", "meaning": "9", "level": "LV1(上)", "unit": "S1-U4-L4", "difficulty": 1, "enabled": true}, {"word": "8", "pos": "num", "meaning": "8", "level": "LV1(上)", "unit": "S1-U4-L4", "difficulty": 1, "enabled": true}, {"word": "10", "pos": "num", "meaning": "10", "level": "LV1(上)", "unit": "S1-U4-L5", "difficulty": 1, "enabled": true}, {"word": "zoo", "pos": "n", "meaning": "动物园", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "zebra", "pos": "n", "meaning": "斑马", "level": "LV1(上)", "unit": "S1-U7-L2", "difficulty": 1, "enabled": true}, {"word": "young", "pos": "adj", "meaning": "年轻的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "year", "pos": "n", "meaning": "年", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "write", "pos": "v", "meaning": "写", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "woman", "pos": "n", "meaning": "女人", "level": "LV1(上)", "unit": "S1-U5-L1", "difficulty": 1, "enabled": true}, {"word": "window", "pos": "n", "meaning": "窗户", "level": "LV1(上)", "unit": "S1-U12-L4", "difficulty": 1, "enabled": true}, {"word": "warm", "pos": "adj", "meaning": "温暖的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "want", "pos": "v", "meaning": "想要", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "walk", "pos": "v", "meaning": "走", "level": "LV1(上)", "unit": "S1-U7-L2", "difficulty": 1, "enabled": true}, {"word": "very", "pos": "adv", "meaning": "非常", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "under", "pos": "prep", "meaning": "在...下面", "level": "LV1(上)", "unit": "S2-U14-L5", "difficulty": 1, "enabled": true}, {"word": "try", "pos": "n", "meaning": "尝试", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "try", "pos": "v", "meaning": "尝试", "level": "LV1(上)", "unit": "S1-U12-L5", "difficulty": 1, "enabled": true}, {"word": "tree", "pos": "n", "meaning": "树", "level": "LV1(上)", "unit": "S1-U7-L1", "difficulty": 1, "enabled": true}, {"word": "train", "pos": "n", "meaning": "火车", "level": "LV1(上)", "unit": "S1-U8-L1", "difficulty": 1, "enabled": true}, {"word": "too", "pos": "adv", "meaning": "也", "level": "LV1(上)", "unit": "S1-U12-L2", "difficulty": 1, "enabled": true}, {"word": "tomorrow", "pos": "adv", "meaning": "明天", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "tomorrow", "pos": "n", "meaning": "明天", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "today", "pos": "adv", "meaning": "今天", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "today", "pos": "n", "meaning": "今天", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "tiger", "pos": "n", "meaning": "老虎", "level": "LV1(上)", "unit": "S1-U5-L3", "difficulty": 1, "enabled": true}, {"word": "those", "pos": "det", "meaning": "那些", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "those", "pos": "pron", "meaning": "那些", "level": "LV1(上)", "unit": "S1-U12-L1", "difficulty": 1, "enabled": true}, {"word": "this", "pos": "det", "meaning": "这个", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "this", "pos": "pron", "meaning": "这个", "level": "LV1(上)", "unit": "S1-U12-L1", "difficulty": 1, "enabled": true}, {"word": "these", "pos": "det", "meaning": "这些", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "these", "pos": "pron", "meaning": "这些", "level": "LV1(上)", "unit": "S1-U12-L1", "difficulty": 1, "enabled": true}, {"word": "that", "pos": "det", "meaning": "那个", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "that", "pos": "pron", "meaning": "那个", "level": "LV1(上)", "unit": "S1-U12-L1", "difficulty": 1, "enabled": true}, {"word": "tell", "pos": "v", "meaning": "告诉", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "teacher", "pos": "n", "meaning": "老师", "level": "LV1(上)", "unit": "S2-U14-L2", "difficulty": 1, "enabled": true}, {"word": "talk", "pos": "v", "meaning": "说话", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "swim", "pos": "v", "meaning": "游泳", "level": "LV1(上)", "unit": "S1-U11-L5", "difficulty": 1, "enabled": true}, {"word": "sun", "pos": "n", "meaning": "太阳", "level": "LV1(上)", "unit": "S1-U8-L2", "difficulty": 1, "enabled": true}, {"word": "study", "pos": "v", "meaning": "学习", "level": "LV1(上)", "unit": "S2-U14-L1", "difficulty": 1, "enabled": true}, {"word": "student", "pos": "n", "meaning": "学生", "level": "LV1(上)", "unit": "S2-U14-L1", "difficulty": 1, "enabled": true}, {"word": "speak", "pos": "v", "meaning": "说", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "some", "pos": "det", "meaning": "一些", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "sofa", "pos": "n", "meaning": "沙发", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "sock", "pos": "n", "meaning": "袜子", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "small", "pos": "adj", "meaning": "小的", "level": "LV1(上)", "unit": "S1-U9-L1", "difficulty": 1, "enabled": true}, {"word": "sleep", "pos": "v", "meaning": "睡觉", "level": "LV1(上)", "unit": "S1-U7-L4", "difficulty": 1, "enabled": true}, {"word": "skirt", "pos": "n", "meaning": "裙子", "level": "LV1(上)", "unit": "S1-U9-L4", "difficulty": 1, "enabled": true}, {"word": "sit", "pos": "v", "meaning": "坐下", "level": "LV1(上)", "unit": "S1-U8-L1", "difficulty": 1, "enabled": true}, {"word": "sister", "pos": "n", "meaning": "姐姐、妹妹", "level": "LV1(上)", "unit": "S1-U8-L1", "difficulty": 1, "enabled": true}, {"word": "short", "pos": "adj", "meaning": "短的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "shoe", "pos": "n", "meaning": "鞋", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "shirt", "pos": "n", "meaning": "衬衫", "level": "LV1(上)", "unit": "S1-U9-L1", "difficulty": 1, "enabled": true}, {"word": "ship", "pos": "n", "meaning": "船", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "sheep", "pos": "n", "meaning": "绵羊", "level": "LV1(上)", "unit": "S1-U5-L3", "difficulty": 1, "enabled": true}, {"word": "school", "pos": "n", "meaning": "学校", "level": "LV1(上)", "unit": "S2-U14-L1", "difficulty": 1, "enabled": true}, {"word": "say", "pos": "v", "meaning": "说", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "sad", "pos": "adj", "meaning": "悲伤的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "run", "pos": "v", "meaning": "跑", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "ruler", "pos": "n", "meaning": "尺子", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "room", "pos": "n", "meaning": "房间", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "rice", "pos": "n", "meaning": "米饭", "level": "LV1(上)", "unit": "S1-U6-L4", "difficulty": 1, "enabled": true}, {"word": "read", "pos": "v", "meaning": "阅读", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "radio", "pos": "n", "meaning": "收音机", "level": "LV1(上)", "unit": "S1-U9-L2", "difficulty": 1, "enabled": true}, {"word": "potato", "pos": "n", "meaning": "土豆", "level": "LV1(上)", "unit": "S1-U7-L3", "difficulty": 1, "enabled": true}, {"word": "play", "pos": "v", "meaning": "玩", "level": "LV1(上)", "unit": "S2-U14-L1", "difficulty": 1, "enabled": true}, {"word": "plane", "pos": "n", "meaning": "飞机", "level": "LV1(上)", "unit": "S1-U8-L3", "difficulty": 1, "enabled": true}, {"word": "pig", "pos": "n", "meaning": "猪", "level": "LV1(上)", "unit": "S1-U7-L4", "difficulty": 1, "enabled": true}, {"word": "phone", "pos": "n", "meaning": "电话", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "phone", "pos": "v", "meaning": "给…...打电话", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "people", "pos": "n", "meaning": "人", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "pencil", "pos": "n", "meaning": "铅笔", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "pea", "pos": "n", "meaning": "豌豆", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "PE", "pos": "n", "meaning": "体育", "level": "LV1(上)", "unit": "S1-U10-L4", "difficulty": 1, "enabled": true}, {"word": "paper", "pos": "adj", "meaning": "纸质的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "paint", "pos": "n", "meaning": "绘画颜料", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "paint", "pos": "v", "meaning": "(用颜料)绘画", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "orange", "pos": "n", "meaning": "橙子", "level": "LV1(上)", "unit": "S1-U10-L3", "difficulty": 1, "enabled": true}, {"word": "open", "pos": "adj", "meaning": "开着的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "one", "pos": "det", "meaning": "一个", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "one", "pos": "pron", "meaning": "一个人(或物)", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "old", "pos": "adj", "meaning": "年老的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "now", "pos": "adv", "meaning": "现在", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "night", "pos": "n", "meaning": "夜晚", "level": "LV1(上)", "unit": "S1-U12-L5", "difficulty": 1, "enabled": true}, {"word": "nice", "pos": "adj", "meaning": "好的", "level": "LV1(上)", "unit": "S1-U6-L3", "difficulty": 1, "enabled": true}, {"word": "new", "pos": "adj", "meaning": "新的", "level": "LV1(上)", "unit": "S1-U9-L2", "difficulty": 1, "enabled": true}, {"word": "mum", "pos": "n", "meaning": "妈妈", "level": "LV1(上)", "unit": "S1-U8-L4", "difficulty": 1, "enabled": true}, {"word": "mouth", "pos": "n", "meaning": "嘴巴", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "mother", "pos": "n", "meaning": "母亲", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "morning", "pos": "n", "meaning": "早上", "level": "LV1(上)", "unit": "S1-U12-L5", "difficulty": 1, "enabled": true}, {"word": "month", "pos": "n", "meaning": "月", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "monkey", "pos": "n", "meaning": "猴子", "level": "LV1(上)", "unit": "S1-U7-L1", "difficulty": 1, "enabled": true}, {"word": "minute", "pos": "n", "meaning": "分钟", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "mine", "pos": "pron", "meaning": "我的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "milk", "pos": "n", "meaning": "牛奶", "level": "LV1(上)", "unit": "S1-U5-L2", "difficulty": 1, "enabled": true}, {"word": "men", "pos": "n", "meaning": "男人(man 的复数)", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "meat", "pos": "n", "meaning": "肉类", "level": "LV1(上)", "unit": "S1-U10-L3", "difficulty": 1, "enabled": true}, {"word": "me", "pos": "pron", "meaning": "我", "level": "LV1(上)", "unit": "S1-U12-L2", "difficulty": 1, "enabled": true}, {"word": "mat", "pos": "n", "meaning": "地垫", "level": "LV1(上)", "unit": "S2-U14-L4", "difficulty": 1, "enabled": true}, {"word": "many", "pos": "det", "meaning": "许多", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "man", "pos": "n", "meaning": "男人", "level": "LV1(上)", "unit": "S1-U5-L1", "difficulty": 1, "enabled": true}, {"word": "make", "pos": "v", "meaning": "制造", "level": "LV1(上)", "unit": "S1-U6-L3", "difficulty": 1, "enabled": true}, {"word": "love", "pos": "v", "meaning": "爱", "level": "LV1(上)", "unit": "S1-U12-L2", "difficulty": 1, "enabled": true}, {"word": "lots of", "pos": "det", "meaning": "大量的", "level": "LV1(上)", "unit": "", "difficulty": 1, "enabled": true}, {"word": "long", "pos": "adj", "meaning": "长的", "level": "LV1(上)", "unit": "S1-U7-L5 ", "difficulty": 1, "enabled": true}]} diff --git a/scripts/generate_listening_choicePic.py b/scripts/generate_listening_choicePic.py new file mode 100755 index 0000000..625b809 --- /dev/null +++ b/scripts/generate_listening_choicePic.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +import argparse +import json +import re +import sys +import os +from typing import List, Dict + +# 角色名称库 +CHARACTERS = ["Otis", "Ben", "Skylar", "Brainy", "Daisy", "Jim", "Paul", "Fred"] + +# 共用L1单词库路径 +WORD_LIST_PATH = os.path.join(os.path.dirname(__file__), "../../listening-drag/references/l1_word_list.json") + +# 难度对应规则 +DIFFICULTY_RULES = { + "A": { + "sentence_length": "≤5词", + "interference": "选项类别完全不同,差异极大", + "description": "简单句,关键词后置,无修饰成分" + }, + "B": { + "sentence_length": "≤8词", + "interference": "同类别不同属性(颜色/大小)", + "description": "简单句,可带1个形容词修饰" + }, + "C": { + "sentence_length": "≤12词", + "interference": "同物品不同动作/状态", + "description": "简单句,可带介词短语修饰" + }, + "D": { + "sentence_length": "≤15词", + "interference": "同场景不同逻辑", + "description": "带简单从句,可包含逻辑连接词" + } +} + +def parse_args(): + parser = argparse.ArgumentParser(description="Generate Listening Picture Choice questions") + parser.add_argument("--knowledge", required=True, help="知识点列表,分号分隔") + parser.add_argument("--difficulty", required=True, choices=["A", "B", "C", "D"], help="难度等级") + parser.add_argument("--count", type=int, default=1, help="生成题目数量,默认1道") + parser.add_argument("--scene", default="", help="题目场景要求,可选") + return parser.parse_args() + +def load_word_list() -> List[str]: + """加载L1单词库""" + try: + with open(WORD_LIST_PATH, "r", encoding="utf-8") as f: + data = json.load(f) + return [word["word"].lower() for word in data["words"]] + except Exception as e: + print(f"警告:加载单词库失败,跳过超纲校验:{str(e)}", file=sys.stderr) + return [] + +def validate_knowledge_with_wordlist(knowledge: str, word_list: List[str]) -> bool: + """校验知识点是否在单词库中""" + if not word_list: + return True + knowledge_words = [item.split()[0].lower() for item in knowledge.split(";") if item.strip()] + out_of_range = [] + for word in knowledge_words: + if word not in word_list: + out_of_range.append(word) + if out_of_range: + print(f"错误:以下知识点超纲,不在L1单词库中:{','.join(out_of_range)}", file=sys.stderr) + return False + return True + +def validate_input(args) -> bool: + """校验输入参数合法性""" + if not args.knowledge.strip(): + print("错误:知识点不能为空", file=sys.stderr) + return False + if args.count < 1 or args.count > 10: + print("错误:题量范围1-10道", file=sys.stderr) + return False + # 超纲校验 + word_list = load_word_list() + if not validate_knowledge_with_wordlist(args.knowledge, word_list): + return False + return True + +def generate_prompt(args) -> str: + """生成生产prompt""" + difficulty_rule = DIFFICULTY_RULES[args.difficulty] + scene_desc = f"场景要求:{args.scene}" if args.scene else "场景自动匹配知识点" + return f""" +你是资深K12英语教研专家,严格按照以下要求生成{args.count}道听力三选一图片选择题: +## 难度要求({args.difficulty}级) +- 句子长度:{difficulty_rule['sentence_length']} +- 干扰项要求:{difficulty_rule['interference']} +- 听力要求:{difficulty_rule['description']} +## 输入参数 +- 知识点:{args.knowledge} +- {scene_desc} +## 生产规则 +1. 每道题包含1段单句听力文本,3张图片选项(A/B/C),1个正确答案 +2. 听力文本自然日常,可使用陈述句、疑问句、祈使句等多种句式,避免生硬 +3. 干扰项设置符合难度要求,正确答案唯一 +4. 角色从{CHARACTERS}中选择 +## 输出格式 +严格按照以下格式输出,不要添加任何额外内容: +【题目组描述】 +听句子,选出与你听到的内容相符的图片。 +--- +【题目1】 +【听力文本】 +[角色]: [符合难度的单句听力内容] +【图片描述】 +A: [图片A核心特征描述,与知识点相关] +B: [图片B核心特征描述,干扰项] +C: [图片C核心特征描述,干扰项] +【正确答案】 +[正确选项字母A/B/C] +【能力项】 +题目1 - 显性事实理解(单句信息点抓取)- [考察核心知识点关键词] +--- +【题目2】 +...(重复上述结构生成{args.count}道题) +""" + +def call_llm(prompt: str) -> str: + """调用大模型生成内容(实际使用时替换为模型API调用)""" + print("请输入模型生成的内容:") + return sys.stdin.read() + +def validate_output(output: str, question_count: int) -> bool: + """校验输出格式合法性""" + # 检查必填字段 + if "【题目组描述】" not in output: + print("错误:缺少题目组描述", file=sys.stderr) + return False + # 检查题目数量 + question_pattern = r"【题目\d+】" + questions = re.findall(question_pattern, output) + if len(questions) != question_count: + print(f"错误:题目数量不符,预期{question_count}道,实际{len(questions)}道", file=sys.stderr) + return False + # 检查每道题的必填字段 + for i in range(1, question_count + 1): + question_section = re.search(rf"【题目{i}】.*?(?=【题目{i+1}】|---|\Z)", output, re.DOTALL) + if not question_section: + print(f"错误:题目{i}格式不完整", file=sys.stderr) + return False + section_content = question_section.group(0) + required_fields = ["【听力文本】", "【图片描述】", "【正确答案】", "【能力项】"] + for field in required_fields: + if field not in section_content: + print(f"错误:题目{i}缺少必填字段{field}", file=sys.stderr) + return False + # 校验能力项格式 + ability_match = re.search(r"【能力项】\s*题目\d+ - 显性事实理解(单句信息点抓取)- .*", section_content) + if not ability_match: + print(f"错误:题目{i}能力项格式不正确", file=sys.stderr) + return False + # 校验答案格式 + answer_match = re.search(r"【正确答案】\s*[ABC]", section_content) + if not answer_match: + print(f"错误:题目{i}答案格式不正确,必须为A/B/C", file=sys.stderr) + return False + return True + +def main(): + args = parse_args() + if not validate_input(args): + sys.exit(1) + prompt = generate_prompt(args) + output = call_llm(prompt) + if validate_output(output, args.count): + print(output) + sys.exit(0) + else: + sys.exit(1) + +if __name__ == "__main__": + main()