llm-data-eval-20261030 / scripts /gate_make_jsonl2.py
Raphael2099's picture
scripts
b2a67ba verified
Raw History Blame Contribute Delete
1.78 kB
# gate_make_jsonl2.py —— WW-6 gate, probe v2: 今译 ONLY (one short 译文 per slip).
# Probe v1 asked for 释文+译文 and the model stopped after 释文, so the three semantic failures
# (越王/楚王, 三 carried from 63, 赏谷) could not be judged in translation. v1 output is kept as
# supplementary punctuation evidence; v2 is the judgeable probe.
# 用法: python gate_make_jsonl2.py OUT.jsonl
import json, sys
SLIPS = [
("1", "吴王夫差起师伐越遂克越邦越王句践失邦移登会稽"),
("2", "之山使大夫种行成于吴曰寡君乏无使使非材种不敢当君天王"),
("3", "敢私告于下执事孤不天上帝降威懠于越邦不在前后当"),
("63", "邦人救火进者莫复王乃惧鼓而复之死者千人王大戚哭泣若主三"),
("64", "日不食乃训为之赏谷既成王亲以授其后既发王焉饮食王焉始命绝"),
("79", "宗庙凡吴之土地民人越君是尽既有之孤余何有面目以视于天下越君其事也"),
]
body = "".join("简%s:%s\n" % (n, t) for n, t in SLIPS)
PROMPT = (
"以下是出土简牍《吴王》篇六支简的校订释文(无句读,简与简按顺序连读)。\n"
"请按简号逐简给出今译,每简一行,只写译文,不要释文、不要说明。要求:紧贴简文,"
"只译简上有的词,不增补简上没有的信息;跨简连读的地方要按文意连起来译。\n\n"
+ body
)
row = {"id": "ww6_gate_v2", "max_new": 900,
"messages": [{"role": "user", "content": PROMPT}],
"slips": [{"slip_no": n, "text": t} for n, t in SLIPS]}
with open(sys.argv[1], "w", encoding="utf-8") as f:
f.write(json.dumps(row, ensure_ascii=False) + "\n")
print("WROTE", sys.argv[1], "prompt_chars", len(PROMPT))