| """ |
| answer_key.py —— "标准答案对照表" + "题目自动分类器"(仅供我们自己调试看结果用) |
| |
| 1. REFERENCE_ANSWERS:一张"标准答案表"。GAIA 这 20 道题的官方正确答案是公开的(来自数据集里 |
| 的 metadata.jsonl 文件),我们把它抄在这里。 |
| 注意:这张表【不参与答题】!agent 答题时根本不会看它。它唯一的用途是:在结果表格里,把 |
| "正确答案"和"我们 agent 提交的答案"并排显示出来,方便我们一眼看出哪几道答错了。 |
| (因为评分服务器只告诉我们总分,不会告诉我们具体哪题对哪题错。) |
| |
| 2. classify_question:根据题目内容/附件类型,自动给每道题贴一个"类型标签"(比如"看图题""音频题" |
| "网页检索题"),同样是为了让结果表格更直观。 |
| """ |
|
|
| import re |
|
|
| |
| REFERENCE_ANSWERS = { |
| "8e867cd7-cff9-4e6c-867a-ff5ddc2550be": "3", |
| "a1e91b78-d3d8-4675-bb8d-62741b4b68a6": "3", |
| "2d83110e-a098-4ebb-9987-066c06fa42d0": "Right", |
| "cca530fc-4052-43b2-b130-b30968d8aa44": "Rd5", |
| "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8": "FunkMonk", |
| "6f37996b-2ac7-44b0-8e68-6d28256631b4": "b, e", |
| "9d191bce-651d-4746-be2d-7ef8ecadb9c2": "Extremely", |
| "cabe07ed-9eca-40ea-8ead-410ef5e83f91": "Louvrier", |
| "3cef3a44-215e-4aed-8e3b-b1e3f08063b7": "broccoli, celery, fresh basil, lettuce, sweet potatoes", |
| "99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3": "cornstarch, freshly squeezed lemon juice, granulated sugar, pure vanilla extract, ripe strawberries", |
| "305ac316-eef6-4446-960a-92d80d542f82": "Wojciech", |
| "f918266a-b3e0-4914-865d-4faa564f1aef": "0", |
| "3f57289b-8c60-48be-bd80-01f8099ca449": "519", |
| "1f975693-876d-457b-a649-393859e79bf3": "132, 133, 134, 197, 245", |
| "840bfca7-4f7b-481a-8794-c560c340185d": "80GSFC21M0002", |
| "bda648d7-d618-4883-88f4-3466eabd860e": "Saint Petersburg", |
| "cf106601-ab4f-4af9-b045-5295fe67b37d": "CUB", |
| "a0c07678-e491-4bbc-8f0b-07405144218f": "Yoshida, Uehara", |
| "7bd855d8-463d-4ed5-93ca-5fe35145f733": "89706.00", |
| "5a0c1adf-205e-4841-a666-7c3ef95def9d": "Claus", |
| } |
|
|
|
|
| def classify_question(question: str, file_name: str = "") -> str: |
| """根据题目和附件名,猜测这道题属于哪种类型,返回一个标签字符串。""" |
| |
| |
| fn = (file_name or "").lower() |
| if fn.endswith((".xlsx", ".xls", ".csv", ".tsv")): |
| return "file: spreadsheet" |
| if fn.endswith((".mp3", ".wav", ".m4a", ".flac", ".ogg")): |
| return "file: audio" |
| if fn.endswith((".png", ".jpg", ".jpeg", ".gif", ".bmp", ".webp")): |
| return "file: image" |
| if fn.endswith((".py", ".txt", ".json", ".c", ".cpp", ".java", ".js")): |
| return "file: code/text" |
| if fn.endswith((".pdf", ".docx")): |
| return "file: document" |
| if fn: |
| return "file: other" |
|
|
| |
| q = question.lower() |
| if "youtube.com" in q or "youtu.be" in q: |
| return "video (YouTube)" |
| |
| if re.search(r"\beht\b", question) or re.search(r"\brewsna\b", q): |
| return "text manipulation" |
| |
| if "|*|" in question or ("commutative" in q) or ("set s" in q): |
| return "logic/table" |
| if "wikipedia" in q: |
| return "web: wikipedia" |
| return "web research" |
|
|