From 9d96ac8cd646d5f0887852369923c414852e312d Mon Sep 17 00:00:00 2001 From: motuo520 Date: Thu, 20 Aug 2026 23:03:38 +0800 Subject: [PATCH] i18n: honor source-content language for extraction labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The extraction prompt (skill.md) is all-English with no label-language rule, so non-English corpora get English labels — LLMs follow the prompt language. Reproduced with a 4-doc Chinese corpus (v8 line / graphifyy 0.9.16, deepseek/qwen): before = 28 nodes, 0/28 Chinese labels (Chinese notes on Kantian ethics produced 'Kantian Deontology' etc.); after = 27/27 Chinese labels, edges 17 -> 21. Append a LANGUAGE RULE after the extraction JSON schema in both skill.md copies (graphify/skill.md and skills/graphify/skill.md). Node IDs stay ASCII; existing graphs relabel on rebuild. --- graphify/skill.md | 2 ++ skills/graphify/skill.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/graphify/skill.md b/graphify/skill.md index c9683689f0..f2226a062f 100644 --- a/graphify/skill.md +++ b/graphify/skill.md @@ -236,6 +236,8 @@ Output exactly this JSON (no other text): {"nodes":[{"id":"filestem_entityname","label":"Human Readable Name","file_type":"code|document|paper|image","source_file":"relative/path","source_location":null,"source_url":null,"captured_at":null,"author":null,"contributor":null}],"edges":[{"source":"node_id","target":"node_id","relation":"calls|implements|references|cites|conceptually_related_to|shares_data_with|semantically_similar_to","confidence":"EXTRACTED|INFERRED|AMBIGUOUS","confidence_score":1.0,"source_file":"relative/path","source_location":null,"weight":1.0}],"hyperedges":[{"id":"snake_case_id","label":"Human Readable Label","nodes":["node_id1","node_id2","node_id3"],"relation":"participate_in|implement|form","confidence":"EXTRACTED|INFERRED","confidence_score":0.75,"source_file":"relative/path"}],"input_tokens":0,"output_tokens":0} ``` +LANGUAGE RULE: Write all human-readable text (node labels, hyperedge labels) in the dominant language of the source content. Chinese source content MUST produce Chinese labels with verbatim Chinese concepts (e.g. 道德义务论, 绝对命令) — do NOT translate them to English. Node IDs stay ASCII per the format rules above. + **Step B3 - Collect, cache, and merge** Wait for all subagents. For each result: diff --git a/skills/graphify/skill.md b/skills/graphify/skill.md index 444f080f12..9c95c9a826 100644 --- a/skills/graphify/skill.md +++ b/skills/graphify/skill.md @@ -233,6 +233,8 @@ Output exactly this JSON (no other text): {"nodes":[{"id":"filestem_entityname","label":"Human Readable Name","file_type":"code|document|paper|image","source_file":"relative/path","source_location":null,"source_url":null,"captured_at":null,"author":null,"contributor":null}],"edges":[{"source":"node_id","target":"node_id","relation":"calls|implements|references|cites|conceptually_related_to|shares_data_with|semantically_similar_to","confidence":"EXTRACTED|INFERRED|AMBIGUOUS","confidence_score":1.0,"source_file":"relative/path","source_location":null,"weight":1.0}],"hyperedges":[{"id":"snake_case_id","label":"Human Readable Label","nodes":["node_id1","node_id2","node_id3"],"relation":"participate_in|implement|form","confidence":"EXTRACTED|INFERRED","confidence_score":0.75,"source_file":"relative/path"}],"input_tokens":0,"output_tokens":0} ``` +LANGUAGE RULE: Write all human-readable text (node labels, hyperedge labels) in the dominant language of the source content. Chinese source content MUST produce Chinese labels with verbatim Chinese concepts (e.g. 道德义务论, 绝对命令) — do NOT translate them to English. Node IDs stay ASCII per the format rules above. + **Step B3 - Collect, cache, and merge** Wait for all subagents. For each result: