kintsugi 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {kintsugi-0.1.0 → kintsugi-0.2.0}/CHANGELOG.md +14 -0
  2. {kintsugi-0.1.0 → kintsugi-0.2.0}/PKG-INFO +33 -10
  3. {kintsugi-0.1.0 → kintsugi-0.2.0}/README.md +32 -9
  4. {kintsugi-0.1.0 → kintsugi-0.2.0}/pyproject.toml +1 -1
  5. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/__init__.py +3 -3
  6. kintsugi-0.2.0/src/kintsugi/_data/frequency_words.py +513 -0
  7. kintsugi-0.2.0/src/kintsugi/_data/languages.py +312 -0
  8. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/cli.py +21 -3
  9. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/frequency.py +24 -11
  10. kintsugi-0.2.0/src/kintsugi/languages.py +88 -0
  11. kintsugi-0.2.0/src/kintsugi/locales.py +72 -0
  12. {kintsugi-0.1.0 → kintsugi-0.2.0}/tests/test_kintsugi.py +29 -9
  13. kintsugi-0.1.0/src/kintsugi/_data/frequency_words.py +0 -53
  14. kintsugi-0.1.0/src/kintsugi/_data/locales.py +0 -66
  15. kintsugi-0.1.0/src/kintsugi/locales.py +0 -89
  16. {kintsugi-0.1.0 → kintsugi-0.2.0}/.gitignore +0 -0
  17. {kintsugi-0.1.0 → kintsugi-0.2.0}/LICENSE +0 -0
  18. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/_data/__init__.py +0 -0
  19. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/_data/attacks.py +0 -0
  20. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/_data/framings.py +0 -0
  21. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/_data/frequency_ja.py +0 -0
  22. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/attacks.py +0 -0
  23. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/detect.py +0 -0
  24. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/engine.py +0 -0
  25. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/framings.py +0 -0
  26. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/judge.py +0 -0
  27. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/providers.py +0 -0
  28. {kintsugi-0.1.0 → kintsugi-0.2.0}/src/kintsugi/transforms.py +0 -0
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ - Full language + variant registry (`kintsugi.languages`): every Google
6
+ Translate and Translated language, plus curated diglossia/dialect variants, as
7
+ BCP-47 codes with base language, script, region, register and listing engines
8
+ (304 entries). A language with no bundled frequency band is still a valid
9
+ attack target.
10
+ - Frequency bands expanded to every FLORES+ language (233 configs) alongside
11
+ wordfreq, with script-aware tokenisation.
12
+ - `kintsugi.locales` is now a view over the full registry; `diglossia_pairs()`
13
+ spans all standard-vs-vernacular contrasts (Singlish, Hinglish, Schweizerdeutsch,
14
+ Arabic dialects, Cantonese, ...).
15
+ - `list-languages` command and `--lang-of` locale support on `frequency`.
16
+
3
17
  ## 0.1.0
4
18
 
5
19
  - Provider-agnostic targets and judges: Ollama, Hugging Face, your own callable,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kintsugi
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Red-teaming for machine translation: attacks, detectors, and judges from a large MT red-team project.
5
5
  Project-URL: Homepage, https://github.com/alvations/kintsugi
6
6
  Project-URL: Repository, https://github.com/alvations/kintsugi
@@ -126,7 +126,9 @@ common = rt.summary(rt.run(bands["frequent"]))
126
126
  rare = rt.summary(rt.run(bands["rare"])) # expect a higher catastrophic rate
127
127
  ```
128
128
 
129
- Bundled languages: `ar de en es fr hi id it ja kn ko nl pl pt ru sv tr vi yue zh zh-Hant`.
129
+ Frequency bands are bundled for every FLORES+ language (233 configs) plus the
130
+ `wordfreq` set and the Japanese gold dictionary; `frequency.languages()` lists
131
+ them. Friendly aliases (`yue`, `kn`, `zh-Hant`, ...) resolve to the right band.
130
132
 
131
133
  ## Locale variants: region, script, register
132
134
 
@@ -147,11 +149,11 @@ rt = RedTeam(OllamaProvider("qwen3.5:0.8b"),
147
149
  ```
148
150
 
149
151
  Covered: region (`pt-BR`/`pt-PT`, `fr-CA`/`fr-CH`, `de-AT`/`de-CH`, `zh-CN`/
150
- `zh-TW`/`zh-HK`/`zh-MO`/`zh-SG`, ...), script (`zh-Hans`/`zh-Hant`, `sr-Cyrl`/
151
- `sr-Latn`, `ms-Latn`/`ms-Arab`, `hi-Deva`/`hi-Latn`, ...), and register
152
- (Singapore Standard English vs Singlish, Indian English vs Hinglish, Jamaican
153
- Standard English vs Patois, Swiss Standard German vs Schweizerdeutsch, MSA vs
154
- Egyptian/Moroccan Arabic, HK written Chinese vs spoken Cantonese).
152
+ `zh-Hant-TW`/`zh-Hant-HK`/`zh-Hant-MO`/`zh-SG`, ...), script (`zh-Hans`/`zh-Hant`,
153
+ `sr-Latn`, `hi-Latn`, ...), and register (Singapore Standard English vs Singlish,
154
+ Indian English vs Hinglish, Jamaican Standard English vs Patois, Swiss Standard
155
+ German vs Schweizerdeutsch, MSA vs Egyptian/Moroccan Arabic, HK written Chinese
156
+ vs spoken Cantonese).
155
157
 
156
158
  ```bash
157
159
  kintsugi list-locales --register creole
@@ -159,9 +161,30 @@ kintsugi list-locales --script Hant
159
161
  kintsugi frequency --target ollama:qwen3.5:0.8b --lang-of zh-Hant --band rare --n 30
160
162
  ```
161
163
 
162
- The full Google Translate / Translated / Apple coverage catalogues are reference
163
- material in [`docs/LANGUAGE_COVERAGE.md`](docs/LANGUAGE_COVERAGE.md), kept out of
164
- the code on purpose (that list is never-ending).
164
+ ## Full language registry
165
+
166
+ `kintsugi.languages` holds **every Google Translate and Translated language**
167
+ plus the curated diglossia/dialect variants above (304 entries), each a BCP-47
168
+ code with base language, script, region, register, listing engines, and a
169
+ frequency band where one is bundled. A language with no band is still a valid
170
+ attack target; frequency bands are bundled for all FLORES+ languages and the
171
+ `wordfreq` set.
172
+
173
+ ```python
174
+ from kintsugi import languages
175
+ languages.by_engine("google") # every Google Translate language/variant
176
+ languages.by_engine("translated") # every translated.com language/variant
177
+ languages.with_band() # those with a bundled frequency band
178
+ languages.get("zh-Hant-HK") # {'code':'zh-Hant-HK','script':'Hant','region':'HK',...}
179
+ ```
180
+
181
+ ```bash
182
+ kintsugi list-languages --engine google
183
+ kintsugi list-languages --with-band
184
+ ```
185
+
186
+ The engine coverage is also written out, with the Apple `language-Script-REGION`
187
+ convention, in [`docs/LANGUAGE_COVERAGE.md`](docs/LANGUAGE_COVERAGE.md).
165
188
 
166
189
  ## Command line
167
190
 
@@ -93,7 +93,9 @@ common = rt.summary(rt.run(bands["frequent"]))
93
93
  rare = rt.summary(rt.run(bands["rare"])) # expect a higher catastrophic rate
94
94
  ```
95
95
 
96
- Bundled languages: `ar de en es fr hi id it ja kn ko nl pl pt ru sv tr vi yue zh zh-Hant`.
96
+ Frequency bands are bundled for every FLORES+ language (233 configs) plus the
97
+ `wordfreq` set and the Japanese gold dictionary; `frequency.languages()` lists
98
+ them. Friendly aliases (`yue`, `kn`, `zh-Hant`, ...) resolve to the right band.
97
99
 
98
100
  ## Locale variants: region, script, register
99
101
 
@@ -114,11 +116,11 @@ rt = RedTeam(OllamaProvider("qwen3.5:0.8b"),
114
116
  ```
115
117
 
116
118
  Covered: region (`pt-BR`/`pt-PT`, `fr-CA`/`fr-CH`, `de-AT`/`de-CH`, `zh-CN`/
117
- `zh-TW`/`zh-HK`/`zh-MO`/`zh-SG`, ...), script (`zh-Hans`/`zh-Hant`, `sr-Cyrl`/
118
- `sr-Latn`, `ms-Latn`/`ms-Arab`, `hi-Deva`/`hi-Latn`, ...), and register
119
- (Singapore Standard English vs Singlish, Indian English vs Hinglish, Jamaican
120
- Standard English vs Patois, Swiss Standard German vs Schweizerdeutsch, MSA vs
121
- Egyptian/Moroccan Arabic, HK written Chinese vs spoken Cantonese).
119
+ `zh-Hant-TW`/`zh-Hant-HK`/`zh-Hant-MO`/`zh-SG`, ...), script (`zh-Hans`/`zh-Hant`,
120
+ `sr-Latn`, `hi-Latn`, ...), and register (Singapore Standard English vs Singlish,
121
+ Indian English vs Hinglish, Jamaican Standard English vs Patois, Swiss Standard
122
+ German vs Schweizerdeutsch, MSA vs Egyptian/Moroccan Arabic, HK written Chinese
123
+ vs spoken Cantonese).
122
124
 
123
125
  ```bash
124
126
  kintsugi list-locales --register creole
@@ -126,9 +128,30 @@ kintsugi list-locales --script Hant
126
128
  kintsugi frequency --target ollama:qwen3.5:0.8b --lang-of zh-Hant --band rare --n 30
127
129
  ```
128
130
 
129
- The full Google Translate / Translated / Apple coverage catalogues are reference
130
- material in [`docs/LANGUAGE_COVERAGE.md`](docs/LANGUAGE_COVERAGE.md), kept out of
131
- the code on purpose (that list is never-ending).
131
+ ## Full language registry
132
+
133
+ `kintsugi.languages` holds **every Google Translate and Translated language**
134
+ plus the curated diglossia/dialect variants above (304 entries), each a BCP-47
135
+ code with base language, script, region, register, listing engines, and a
136
+ frequency band where one is bundled. A language with no band is still a valid
137
+ attack target; frequency bands are bundled for all FLORES+ languages and the
138
+ `wordfreq` set.
139
+
140
+ ```python
141
+ from kintsugi import languages
142
+ languages.by_engine("google") # every Google Translate language/variant
143
+ languages.by_engine("translated") # every translated.com language/variant
144
+ languages.with_band() # those with a bundled frequency band
145
+ languages.get("zh-Hant-HK") # {'code':'zh-Hant-HK','script':'Hant','region':'HK',...}
146
+ ```
147
+
148
+ ```bash
149
+ kintsugi list-languages --engine google
150
+ kintsugi list-languages --with-band
151
+ ```
152
+
153
+ The engine coverage is also written out, with the Apple `language-Script-REGION`
154
+ convention, in [`docs/LANGUAGE_COVERAGE.md`](docs/LANGUAGE_COVERAGE.md).
132
155
 
133
156
  ## Command line
134
157
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "kintsugi"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "Red-teaming for machine translation: attacks, detectors, and judges from a large MT red-team project."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -19,7 +19,7 @@ Quick start::
19
19
  """
20
20
  from __future__ import annotations
21
21
 
22
- from . import frequency, framings, locales, transforms
22
+ from . import frequency, framings, languages, locales, transforms
23
23
  from .attacks import (
24
24
  Attack,
25
25
  categories,
@@ -39,13 +39,13 @@ from .providers import (
39
39
  Provider,
40
40
  )
41
41
 
42
- __version__ = "0.1.0"
42
+ __version__ = "0.2.0"
43
43
 
44
44
  __all__ = [
45
45
  "RedTeam", "Finding", "LANG_PAIRS",
46
46
  "Attack", "load_attacks", "iter_attacks", "categories", "category_names", "observed_rates",
47
47
  "Provider", "OllamaProvider", "HuggingFaceProvider", "CallableProvider", "AnthropicProvider",
48
48
  "Judge", "Verdict", "prefilter", "detect_profanity",
49
- "transforms", "framings", "frequency", "locales",
49
+ "transforms", "framings", "frequency", "locales", "languages",
50
50
  "__version__",
51
51
  ]