sh2orc commited on
Commit
3c1b0be
·
verified ·
1 Parent(s): cee24c7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +200 -0
README.md CHANGED
@@ -1,3 +1,203 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - ko
5
+ - en
6
+ - zh
7
+ - ja
8
+ - vi
9
  ---
10
+
11
+ # Semantic Router Instruction Dataset — Multilingual (`dataset.all.jsonl`)
12
+
13
+ A multilingual instruction dataset for training and evaluating the
14
+ semantic-turn router: a model that classifies one utterance along 14 axes
15
+ simultaneously. A single JSONL file of five languages × 600,000 rows =
16
+ **3,000,000 rows total**. Every row's `instruction` actually contains the
17
+ content signal its axis/value label depends on.
18
+
19
+ - **Scale**: 600,000 rows per language (14 axes × 150 values fully covered,
20
+ fixed per-value counts — identical in every language)
21
+ - **Languages**: Korean · English · Chinese · Japanese · Vietnamese
22
+ - **Parallelism**: label-parallel, **not** text-parallel — each language block
23
+ is authored natively in that language; no row is a translation of another
24
+ language's row. Translation-parallel training data invites the router to key
25
+ on translation artifacts, so it is deliberately excluded.
26
+ - **Character**: every row is a long-form composed turn (context + request +
27
+ constraints/branches). en/zh/ja/vi are built with six distinct structural
28
+ authoring engines so the corpus is not a single assembly pattern.
29
+
30
+ ## Dataset overview
31
+
32
+ | Item | Value |
33
+ |---|---|
34
+ | Total rows | 3,000,000 (exactly 600,000 × 5 languages) |
35
+ | Size | 1,027,674,919 bytes (≈ 0.96 GiB), uncompressed |
36
+ | Encoding | UTF-8, one JSON object per line, no header |
37
+ | Block order | ko → en → zh → ja → vi (contiguous per-language blocks, no shuffle) |
38
+
39
+ Block boundaries: rows 1–600,000 = ko, 600,001–1,200,000 = en,
40
+ 1,200,001–1,800,000 = zh, 1,800,001–2,400,000 = ja, 2,400,001–3,000,000 = vi.
41
+ Row order inside each block is fixed and reproduces identically on rebuild.
42
+
43
+ ## Schema
44
+
45
+ Each row is a JSON object with four fields (`lang` always first):
46
+
47
+ ```json
48
+ {"lang":"en","instruction":"I'm putting together the quarterly ops review and my notes are a mess, so pull the numbers from the attached workbook and build the review deck. Keep it under ten slides, lead with the churn story, and if the March figures are missing, use February and say on the slide.","category":"service","value":"presentation"}
49
+ ```
50
+
51
+ | Field | Type | Description |
52
+ |---|---|---|
53
+ | `lang` | string | One of `ko` / `en` / `zh` / `ja` / `vi` |
54
+ | `instruction` | string | User utterance. Unique within each language block (all 600k verified) |
55
+ | `category` | string | One of the 14 axes |
56
+ | `value` | string | One of that axis's values (150 values total) |
57
+
58
+ Label strings (`category`, `value`) are English snake_case in **all** blocks,
59
+ including the non-English ones — they are the router's target vocabulary and
60
+ are deliberately kept language-independent.
61
+
62
+ ## Axes, values, allocation
63
+
64
+ The table below applies **identically to every language block** (file-wide,
65
+ each axis's total is 5× the table figure — e.g. `service` is 96,000 rows per
66
+ language → 480,000 rows in the whole file):
67
+
68
+ | Axis | Values | Rows (per language) | Values |
69
+ |---|---:|---:|---|
70
+ | `service` | 16 | 96,000 | general, presentation, image, data_analysis, place_search, web_search, knowledge_search, calendar, memo, works, connector, artifact, coding, translation, skill, reasoning |
71
+ | `presentationSkillId` | 56 | 112,000 | executive-strategy, board-update, quarterly-business-review, sales-proposal, investor-pitch, training-explainer, technical-architecture, research-report, marketing-campaign, product-launch, product-roadmap, consulting-diagnosis, all-hands-update, thesis-research, crisis-communication, demo-day-pitch, compliance-training, lesson-lecture, customer-qbr, analyst-briefing, okr-review, esg-report, incident-postmortem, thesis-defense, grant-proposal, workshop-facilitation, competitive-analysis, investor-update, annual-report, pricing-proposal, analytics-readout, customer-onboarding, vendor-selection, market-entry, company-onboarding, case-study-analysis, model-un-position, lab-meeting, self-review, conference-talk, resume-portfolio, nonprofit-pitch, policy-briefing, earnings-brief, m-a-proposal, org-redesign, regulatory-response, course-syllabus, exam-prep, hobby-explainer, travel-itinerary, deck-redesign, deck-exec-polish, deck-board-upgrade, deck-content-cleanup, none |
72
+ | `contentDomain` | 15 | 60,000 | social, play, self_capability, affective_state, creative, support, explore, personal_scope, opinion, code_work, formal_reasoning, supplied_material, explicit_lookup, multi_step_research, unresolved |
73
+ | `action` | 14 | 56,000 | respond, create, revise, import, analyze, search, export, delete, translate, summarize, explain, compare, execute, none |
74
+ | `dialogueAct` | 10 | 40,000 | clarification_answer, option_selection, confirm, decline, correction, continue_output, preference_directive, meta_conversation, undo_action, none |
75
+ | `sourcePolicies` | 7 | 42,000 | web, internal, memory, attachments, conversation_only, auto, none |
76
+ | `memoryIntent` | 7 | 28,000 | informational, transactional, conversational, analytical, personal, navigational, none |
77
+ | `requestedOutputs` | 5 | 34,000 | chat, docx, xlsx, pptx, image |
78
+ | `diagramKind` | 4 | 24,000 | structure, visualization, plan, none |
79
+ | `presentationMode` | 4 | 24,000 | fast, professional, creative, none |
80
+ | `complexity` | 4 | 32,000 | simple, standard, complex, hard |
81
+ | `artifactKind` | 3 | 18,000 | diagram, interactive, none |
82
+ | `analysisMode` | 3 | 18,000 | focused, comprehensive, none |
83
+ | `artifactComplexity` | 2 | 16,000 | simple, complex |
84
+
85
+ Per-value counts are the row count divided by the value count (e.g. 6,000 per
86
+ `service` value, 2,000 per `presentationSkillId` value — 30,000 / 10,000
87
+ respectively file-wide). Each `instruction` is labeled with exactly one
88
+ `(category, value)` pair — rows exist per axis, not as multi-label records.
89
+ Because per-value counts are identical across languages, any language block
90
+ you slice has the same label distribution (class priors) — this is what makes
91
+ cross-lingual evaluation compare like with like.
92
+
93
+ ## Cross-lingual design
94
+
95
+ - **Label-parallel, not text-parallel.** The five blocks align on labels only.
96
+ No instruction is a translation of another block's instruction.
97
+ - **Same class priors everywhere.** Identical per-value counts mean every
98
+ per-language slice has the same label distribution.
99
+ - **Native authorship.** Each language block is written from scratch in that
100
+ language: its own slot pools (topics, companies, cities, apps, document and
101
+ file names, people, math/logic prompts), its own group mains, and its own
102
+ engine banks (openers, scene sentences, constraints, email frames,
103
+ conversational fillers, closers). Real-world anchors are localized — Chinese
104
+ cities and platforms for zh, Vietnamese names and places for vi, and so on —
105
+ the way native speakers actually write.
106
+ - **Technical terms stay in their original script** where that is the natural
107
+ usage (`React`, `Kubernetes`, `x²−5x+6=0`, `ECONNREFUSED`) — matching how
108
+ each language's technical community writes.
109
+
110
+ ## Authoring architecture
111
+
112
+ The Korean block composes every row in a single shape: situational opener
113
+ (+background) + group request + constraint tails. The en/zh/ja/vi blocks route
114
+ each row through one of **six structural authoring engines**:
115
+
116
+ | Engine | Shape |
117
+ |---|---|
118
+ | `composed` | Situational opener (95%) + optional background (38%) + main request + 1–4 constraint tails; the last tail may fork conditionally (~35%) |
119
+ | `brief` | 2–3 flowing scene sentences + connector (55%) with the request woven in + optional softener (50%) — no bolted-on opener/tail skeleton |
120
+ | `numbered` | Lead-in + main request + enumerated constraints (`1) …; 2) …; 3) …`, 2–4 items) |
121
+ | `convo` | Conversational filler + request + self-correction (30%) + softener (70%) — dialogue-register turns |
122
+ | `email` | Inline email framing: greeting + context + ask + request + tail (60%) + closer |
123
+ | `forked` | Optional opener (60%) + request + 1–2 explicit if/then branch tails + an "either way" base line |
124
+
125
+ Rows are routed first to one of six **profiles** (by axis/value); each profile
126
+ fixes the engine mix and the register (work / casual / terse):
127
+
128
+ | Profile | Applied to | Engine mix (weights) |
129
+ |---|---|---|
130
+ | general | most `service`, `sourcePolicies`, `diagramKind`, `artifactKind`, `presentationMode`, `requestedOutputs`, … | composed 30, brief 22, numbered 16, email 12, forked 12, convo 8 |
131
+ | formal | `complexity::hard`, `contentDomain::formal_reasoning` | brief 28, numbered 24, composed 20, email 14, forked 14 |
132
+ | code | `contentDomain::code_work`, `service::coding` | numbered 32, composed 22, brief 18, forked 16, email 6, convo 6 |
133
+ | quick | `complexity::simple` | composed 42, brief 30, convo 20, numbered 8 |
134
+ | personal | `contentDomain::{social,support,opinion,explore,personal_scope}`, `memoryIntent::personal` | convo 36, brief 26, composed 22, email 6, forked 6, numbered 4 |
135
+ | micro | `dialogueAct` (all), `memoryIntent::{conversational,navigational,none}`, `contentDomain::{play,self_capability,affective_state,unresolved}`, `action::none` | convo 72, composed 20, brief 8 |
136
+
137
+ The micro profile keeps short dialogue turns ("맞아", "嗯嗯", "そうだね"-style utterances) intact while padding them with surrounding context clauses, so the label's meaning survives inside a long-form distribution.
138
+
139
+ ### Per-language contracts
140
+
141
+ The engine is language-agnostic; every string and orthographic rule lives in a
142
+ language pack (`dataset/generator/i18n/{en,zh,ja,vi}-*.mjs`):
143
+
144
+ | Lang | Joining | Terminal | Enumerated list | Per-language notes |
145
+ |---|---|---|---|---|
146
+ | en | space-joined | `.` | `1)` + `;` | email engine lowercases the joined ask; non-Latin leak scan with a math-glyph allowlist (`√ ≡ → ∞ — …`) |
147
+ | zh | no inter-word spaces | `。` | `1)` + `;` | fullwidth punctuation, 「」 quotation marks, spacing-normalizing post-pass, doubled-CJK-run scan |
148
+ | ja | no inter-word spaces | `。` | `1)` + `;` | same CJK contract as zh; polite/plain register mix |
149
+ | vi | space-joined | `.` | `1)` + `;` | full diacritics; doubled-word scan covers `À-ỹ` |
150
+
151
+ ## Quality gates and integrity
152
+
153
+ **Data generation** (when each language's 600,000 rows are produced):
154
+
155
+ - **Deterministic**: mulberry32 seeded with FNV-1a over
156
+ `` `${lang}::${category}::${value}` `` plus per-pass offsets; no
157
+ `Math.random`, no timestamps. Identical inputs rebuild byte-identical
158
+ output. The final shuffle uses a fixed global seed plus a per-language
159
+ offset. Writes are atomic (`.tmp` + rename).
160
+ - **Generation**: 14 passes per group, ~1.2× attempts, local + global dedupe
161
+ across all 150 groups — each language's 600,000 instructions are unique.
162
+ - **Build-time validation** (a build is OK only when all of these hold):
163
+ exactly 600,000 lines; every line valid JSON with exactly
164
+ `instruction/category/value`; zero unresolved `{slot}` leaks; 100% unique
165
+ instructions; and the language-specific scans at zero — doubled-word rows
166
+ for en/vi, doubled 2-char CJK runs for zh/ja, non-Latin leaks for en.
167
+
168
+ **File integrity** — `dataset.all.jsonl` only exists if every gate below
169
+ passes (`generator/merge.mjs` enforces them at write time; on failure no file
170
+ is left behind):
171
+
172
+ 1. Fixed language order: ko → en → zh → ja → vi contiguous blocks
173
+ 2. Every row JSON-parsed + 4 field type checks + `lang` code consistency
174
+ 3. Exactly 600,000 rows per language · 3,000,000 total
175
+ 4. Written to `.tmp` and renamed only on success (atomic) — a partial file
176
+ that failed validation cannot exist
177
+
178
+ ## Length profile
179
+
180
+ All five blocks share the long-form design goal, but absolute character counts
181
+ are script-dependent (a Han character carries far more than a Latin letter) —
182
+ **compare within a script, not across**:
183
+
184
+ | Lang | Avg chars | ≥80 | ≥120 | Min | Max |
185
+ |---|---:|---:|---:|---:|---:|
186
+ | ko | 140.2 | 92.8% | 69.5% | 25 | 273 |
187
+ | en | 204.4 | 95.0% | 85.6% | 17 | 483 |
188
+ | zh | 72.8 | 39.4% | 3.0% | 5 | 165 |
189
+ | ja | 98.4 | 73.1% | 26.6% | 6 | 226 |
190
+ | vi | 205.9 | 94.9% | 86.7% | 12 | 470 |
191
+
192
+ ## Caveats
193
+
194
+ - This is template-combination generated data. Individual sentences are
195
+ grammatical, but rare semantic mismatches between slot combinations (a work
196
+ topic meeting a casual opener, etc.) can occur. Labels are unaffected;
197
+ account for it in naturalness evaluations.
198
+ - The same topic may appear under different axes, and near-identical strings
199
+ may exist across different axes within one language block. Instructions are
200
+ unique **within each language block** (verified exhaustively); blocks are
201
+ not deduped against each other (by design).
202
+ - Cultural/regional anchors differ per language on purpose. The invariant is
203
+ the label, not the surface content.