Commit ·
b529947
0
Parent(s):
Update repository
Browse filesCo-authored-by: laurier-rochon <laurier-rochon@users.noreply.huggingface.co>
Co-authored-by: pveugen <pveugen@users.noreply.huggingface.co>
Co-authored-by: akagabi <akagabi@users.noreply.huggingface.co>
- .gitattributes +35 -0
- README.md +316 -0
- THIRD_PARTY_NOTICES.md +72 -0
- labels.json +176 -0
- tongue.onnx +3 -0
- tongue_int4.bin +3 -0
- tongue_int8.bin +3 -0
- tongue_meta.json +197 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: desert-ant-labs-source-available-1.0
|
| 4 |
+
license_link: https://license.desertant.com/1.0
|
| 5 |
+
language:
|
| 6 |
+
- af
|
| 7 |
+
- am
|
| 8 |
+
- ar
|
| 9 |
+
- as
|
| 10 |
+
- az
|
| 11 |
+
- be
|
| 12 |
+
- bg
|
| 13 |
+
- bn
|
| 14 |
+
- bo
|
| 15 |
+
- ca
|
| 16 |
+
- chr
|
| 17 |
+
- cs
|
| 18 |
+
- cy
|
| 19 |
+
- da
|
| 20 |
+
- de
|
| 21 |
+
- dv
|
| 22 |
+
- el
|
| 23 |
+
- en
|
| 24 |
+
- eo
|
| 25 |
+
- es
|
| 26 |
+
- et
|
| 27 |
+
- eu
|
| 28 |
+
- fa
|
| 29 |
+
- fi
|
| 30 |
+
- fr
|
| 31 |
+
- ga
|
| 32 |
+
- gl
|
| 33 |
+
- gu
|
| 34 |
+
- he
|
| 35 |
+
- hi
|
| 36 |
+
- hr
|
| 37 |
+
- hu
|
| 38 |
+
- hy
|
| 39 |
+
- id
|
| 40 |
+
- is
|
| 41 |
+
- it
|
| 42 |
+
- ja
|
| 43 |
+
- ka
|
| 44 |
+
- kk
|
| 45 |
+
- km
|
| 46 |
+
- kn
|
| 47 |
+
- ko
|
| 48 |
+
- ku
|
| 49 |
+
- ky
|
| 50 |
+
- la
|
| 51 |
+
- lo
|
| 52 |
+
- lt
|
| 53 |
+
- lv
|
| 54 |
+
- mk
|
| 55 |
+
- ml
|
| 56 |
+
- mn
|
| 57 |
+
- mr
|
| 58 |
+
- ms
|
| 59 |
+
- my
|
| 60 |
+
- ne
|
| 61 |
+
- nl
|
| 62 |
+
- no
|
| 63 |
+
- or
|
| 64 |
+
- pa
|
| 65 |
+
- pl
|
| 66 |
+
- pt
|
| 67 |
+
- ro
|
| 68 |
+
- ru
|
| 69 |
+
- si
|
| 70 |
+
- sk
|
| 71 |
+
- sl
|
| 72 |
+
- sq
|
| 73 |
+
- sr
|
| 74 |
+
- st
|
| 75 |
+
- sv
|
| 76 |
+
- sw
|
| 77 |
+
- syr
|
| 78 |
+
- ta
|
| 79 |
+
- te
|
| 80 |
+
- th
|
| 81 |
+
- tl
|
| 82 |
+
- tr
|
| 83 |
+
- ug
|
| 84 |
+
- uk
|
| 85 |
+
- ur
|
| 86 |
+
- vi
|
| 87 |
+
- xh
|
| 88 |
+
- yo
|
| 89 |
+
- zh
|
| 90 |
+
tags:
|
| 91 |
+
- language-identification
|
| 92 |
+
- language-detection
|
| 93 |
+
- langid
|
| 94 |
+
- text-classification
|
| 95 |
+
- on-device
|
| 96 |
+
- edge-ai
|
| 97 |
+
- mobile
|
| 98 |
+
- browser
|
| 99 |
+
- offline
|
| 100 |
+
- onnx
|
| 101 |
+
- multilingual
|
| 102 |
+
pipeline_tag: text-classification
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
<!-- card-header:start (generated from manifest.json, edit below this block) -->
|
| 106 |
+
# Tongue
|
| 107 |
+
|
| 108 |
+
Detect language based on 3 words.
|
| 109 |
+
|
| 110 |
+
On-device language identification for short text across 84 languages.
|
| 111 |
+
|
| 112 |
+
- **SDKs, install and examples:** https://github.com/Desert-Ant-Labs/desert-ant-core/blob/main/docs/models/tongue.md
|
| 113 |
+
- **Website:** https://desertant.com/models/tongue/
|
| 114 |
+
|
| 115 |
+
<!-- card-header:end -->
|
| 116 |
+
|
| 117 |
+
<!-- card-install:start (generated from manifest.json, edit below this block) -->
|
| 118 |
+
| | |
|
| 119 |
+
| --- | --- |
|
| 120 |
+
| **Platforms** | iOS, macOS, tvOS, visionOS, Android, Linux, Windows, Browser, Node |
|
| 121 |
+
| **Languages** | 84 |
|
| 122 |
+
| **Weights** | [v1.0.0](https://huggingface.co/desert-ant-labs/tongue) |
|
| 123 |
+
|
| 124 |
+
## Install
|
| 125 |
+
|
| 126 |
+
**Swift** ([requirements](https://github.com/Desert-Ant-Labs/desert-ant-core/blob/main/README.md#swift))
|
| 127 |
+
|
| 128 |
+
```swift
|
| 129 |
+
.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core.git", from: "3.1.0")
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
Then add the `Tongue` product to your target.
|
| 133 |
+
|
| 134 |
+
**Kotlin** ([requirements](https://github.com/Desert-Ant-Labs/desert-ant-core/blob/main/README.md#android))
|
| 135 |
+
|
| 136 |
+
```kotlin
|
| 137 |
+
implementation("ai.desertant:tongue:3.1.0")
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
**JavaScript** ([requirements](https://github.com/Desert-Ant-Labs/desert-ant-core/blob/main/README.md#javascript-and-typescript))
|
| 141 |
+
|
| 142 |
+
```bash
|
| 143 |
+
npm i @desert-ant-labs/tongue
|
| 144 |
+
```
|
| 145 |
+
<!-- card-install:end -->
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
Name the language from three words, across **84 languages**. Built for where detection
|
| 149 |
+
is hardest and most useful on a device: search boxes, chat messages, keyboard input. The
|
| 150 |
+
shipped weights are **2MB** int8 (2,104,940 bytes), there is no tokenizer and no vocabulary
|
| 151 |
+
file, and a detection costs tens of microseconds.
|
| 152 |
+
|
| 153 |
+
> `"kann ich das haben"` → German · `"안녕하세요"` → Korean · `"привет как дела"` → Russian · `"quanto costa il biglietto"` → Italian
|
| 154 |
+
|
| 155 |
+
On genuinely ambiguous input it says so rather than guessing: `"la casa"` comes
|
| 156 |
+
back as Italian *or* Spanish, because the phrase is equally both.
|
| 157 |
+
|
| 158 |
+
**Live demo:** [desert-ant-labs/tongue-demo](https://huggingface.co/spaces/desert-ant-labs/tongue-demo)
|
| 159 |
+
, runs entirely in your browser; nothing you type leaves the page.
|
| 160 |
+
|
| 161 |
+
## Files
|
| 162 |
+
|
| 163 |
+
| File | Format | Size | Contents |
|
| 164 |
+
|---|---|---:|---|
|
| 165 |
+
| `tongue_int8.bin` | Raw int8 + fp32 | 2.01 MiB | The shipped artifact. Byte-identical to what the live demo runs. |
|
| 166 |
+
| `tongue_int4.bin` | Raw int4 + fp32 | 1.01 MiB | Half-size alternative for tight bundles. Costs roughly 0.4pp on short text, see Sizes. |
|
| 167 |
+
| `tongue.onnx` | ONNX (fp32, opset 17) | 8.4MB | Portable graph for onnxruntime / onnxruntime-web. |
|
| 168 |
+
| `tongue_meta.json` | JSON | tiny | Runtime tables: label order, hashing constants, script routing. |
|
| 169 |
+
| `labels.json` | JSON | tiny | The 59 model labels plus the script-decided languages, with English and native names. |
|
| 170 |
+
|
| 171 |
+
There is no tokenizer file, so nothing has to be shipped or version-matched
|
| 172 |
+
alongside the weights.
|
| 173 |
+
|
| 174 |
+
## Inputs and outputs
|
| 175 |
+
|
| 176 |
+
**Input:** a short UTF-8 string, up to 512 characters.
|
| 177 |
+
**Output:** ranked ISO 639-1/639-3 codes with probabilities, plus a reliability
|
| 178 |
+
signal (`confident` / `likely` / `tentative`). Script-decided inputs return a
|
| 179 |
+
single confident answer.
|
| 180 |
+
|
| 181 |
+
The ONNX graph carries **only the head**: `values` (int64 hashed bucket ids) and
|
| 182 |
+
`offsets` (int64 per-sample starts) in, `logits` out. Normalization, hashing and
|
| 183 |
+
script routing run in the host before the graph; `tongue_meta.json` documents them.
|
| 184 |
+
|
| 185 |
+
## Coverage
|
| 186 |
+
|
| 187 |
+
59 languages are learned by the lexical model and a further 25 are decided by
|
| 188 |
+
script alone, across 31 scripts, Latin, Cyrillic, Arabic, Greek and the CJK and
|
| 189 |
+
Indic families among them, for **84 languages** in total. One of the 84,
|
| 190 |
+
Mongolian, is detected only in the traditional Mongolian script; see failure
|
| 191 |
+
mode 3.
|
| 192 |
+
|
| 193 |
+
## Sizes
|
| 194 |
+
|
| 195 |
+
Two quantisations of the same weights ship side by side. Pick on bundle budget,
|
| 196 |
+
not on principle.
|
| 197 |
+
|
| 198 |
+
| | `tongue_int8.bin` | `tongue_int4.bin` |
|
| 199 |
+
|---|---|---|
|
| 200 |
+
| Size | 2.01 MiB | **1.01 MiB** |
|
| 201 |
+
| FLORES 2-word | 0.869 | 0.866 |
|
| 202 |
+
| FLORES 5-word | 0.974 | 0.973 |
|
| 203 |
+
| Held-out single words | 0.759 | 0.752 |
|
| 204 |
+
| Held-out sentences | 0.971 | 0.970 |
|
| 205 |
+
|
| 206 |
+
The int4 loss lands almost entirely on one- and two-word input; full sentences
|
| 207 |
+
are unaffected within measurement noise. Since short text is what this model is
|
| 208 |
+
for, int8 stays the default and int4 is the option when a megabyte matters more
|
| 209 |
+
than the last half point.
|
| 210 |
+
|
| 211 |
+
## Failure modes (read before deploying)
|
| 212 |
+
|
| 213 |
+
Publishing these is part of the product.
|
| 214 |
+
|
| 215 |
+
**1. One or two words is often genuinely undecidable, and no model size fixes
|
| 216 |
+
it.** A single common word frequently belongs to several languages at once
|
| 217 |
+
(`"sale"` is English, French and Italian; `"la casa"` is equally Italian and
|
| 218 |
+
Spanish). tongue reports a tie or a tentative answer in these cases, and does not
|
| 219 |
+
catch every one: a phrase mixing languages, like `"un garage sale"`, can still
|
| 220 |
+
draw a confident-looking single answer.
|
| 221 |
+
Mitigation: treat low-reliability output as "unknown", not as an answer, and ask
|
| 222 |
+
for more text where the product allows it.
|
| 223 |
+
|
| 224 |
+
**2. Malay and Indonesian are not reliably separable.** They share vocabulary
|
| 225 |
+
and orthography to the point where short samples carry no distinguishing
|
| 226 |
+
signal. This is a structural limit, not a tuning gap, it is not cheaply
|
| 227 |
+
closable at this size, and every detector we measured struggles with it.
|
| 228 |
+
Mitigation: if you need the distinction, treat `ms`/`id` as one bucket or
|
| 229 |
+
disambiguate from user locale.
|
| 230 |
+
|
| 231 |
+
**3. Mongolian is detected only in the traditional Mongolian script.**
|
| 232 |
+
Mongolian written in Cyrillic, the dominant modern orthography, is not
|
| 233 |
+
distinguished from the other Cyrillic languages and will usually come back as
|
| 234 |
+
Russian. The language count includes Mongolian because the traditional script
|
| 235 |
+
works; Cyrillic Mongolian does not. Mitigation: do not rely on tongue for
|
| 236 |
+
Cyrillic Mongolian.
|
| 237 |
+
|
| 238 |
+
**4. Brand names, numbers and code are not language.** `"Samsung Galaxy"`,
|
| 239 |
+
`"v1.2.3"` and `"2024 annual report"` have no correct answer; the model will
|
| 240 |
+
still return its best guess for anything with letters in it. Mitigation: filter
|
| 241 |
+
non-prose input before detection.
|
| 242 |
+
|
| 243 |
+
**5. Single-word scores are vocabulary recognition, not generalization.** The
|
| 244 |
+
frequent words of a language appear in everyone's training data, so any
|
| 245 |
+
detector's single-word accuracy partly measures memorized vocabulary. Read the
|
| 246 |
+
word-pair and sentence numbers as the generalization signal.
|
| 247 |
+
|
| 248 |
+
## Measured quality
|
| 249 |
+
|
| 250 |
+
Every number below is measured on the shipped int8 weights, on three
|
| 251 |
+
public benchmarks, with other detectors run on the identical rows and language
|
| 252 |
+
subsets. Higher is better.
|
| 253 |
+
|
| 254 |
+
### FLORES-200
|
| 255 |
+
|
| 256 |
+
Sentences from FLORES-200 truncated to their first 2, 3 and 5 words. Accuracy
|
| 257 |
+
over the 20 languages the three detectors share.
|
| 258 |
+
|
| 259 |
+
| Detector | Size | 2 words | 3 words | 5 words |
|
| 260 |
+
|---|---|---|---|---|
|
| 261 |
+
| **tongue** | **2MB** | **0.869** | **0.933** | **0.974** |
|
| 262 |
+
| lingua | 293MB | 0.800 | 0.887 | 0.956 |
|
| 263 |
+
| eld | 1MB | 0.780 | 0.856 | 0.912 |
|
| 264 |
+
|
| 265 |
+
### The lingua test set, the benchmark that library publishes
|
| 266 |
+
|
| 267 |
+
1,000 single words, word pairs and sentences per language, drawn from the
|
| 268 |
+
same collection lingua trains on. Accuracy over the languages we share.
|
| 269 |
+
|
| 270 |
+
| Detector | Size | Single words | Word pairs | Sentences |
|
| 271 |
+
|---|---|---|---|---|
|
| 272 |
+
| **tongue** | **2MB** | **0.746** | **0.909** | **0.988** |
|
| 273 |
+
| lingua | 293MB | 0.752 | 0.915 | 0.985 |
|
| 274 |
+
|
| 275 |
+
### eld, an independent benchmark
|
| 276 |
+
|
| 277 |
+
Accuracy over the languages tongue supports (53,035 single-word rows,
|
| 278 |
+
53,613 word pairs, 53,141 sentences, 9,066 tweets).
|
| 279 |
+
Apple is the built-in system detector; HeLI-OTS is a 51MB JVM model. lingua 2.2.0 installs as a
|
| 280 |
+
single 293MB compiled extension with its language models embedded.
|
| 281 |
+
|
| 282 |
+
| Detector | Size | Tweets | Single words | Word pairs | Sentences |
|
| 283 |
+
|---|---|---|---|---|---|
|
| 284 |
+
| **tongue** | **2MB** | **0.992** | **0.759** | **0.887** | **0.971** |
|
| 285 |
+
| lingua | 293MB | 0.984 | 0.756 | 0.894 | 0.950 |
|
| 286 |
+
| HeLI-OTS | 51MB | 0.986 | 0.683 | 0.843 | 0.967 |
|
| 287 |
+
| Apple | system | 0.997 | 0.641 | 0.719 | 0.748 |
|
| 288 |
+
|
| 289 |
+
## Latency
|
| 290 |
+
|
| 291 |
+
Measured per single detection in JavaScript on an Apple-silicon laptop: 0.013ms for one word, 0.028ms for a short sentence, 0.10ms at 193 characters (p99 0.24ms). On-device budgets on phone-class hardware will be higher; the design target is under 1ms.
|
| 292 |
+
|
| 293 |
+
<!-- card-footer:start (generated from manifest.json, edit above this block) -->
|
| 294 |
+
## License
|
| 295 |
+
|
| 296 |
+
[Desert Ant Labs Source-Available License](https://license.desertant.com/1.0). Free for most
|
| 297 |
+
apps, and a commercial license is required at scale. Full terms are at the link.
|
| 298 |
+
Licensing: <licensing@desertant.com>.
|
| 299 |
+
|
| 300 |
+
See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
|
| 301 |
+
|
| 302 |
+
## Citation
|
| 303 |
+
|
| 304 |
+
```bibtex
|
| 305 |
+
@software{tongue_2026,
|
| 306 |
+
title = {Tongue: On-device language identification for short text across 84 languages},
|
| 307 |
+
author = {Desert Ant Labs},
|
| 308 |
+
year = {2026},
|
| 309 |
+
url = {https://huggingface.co/desert-ant-labs/tongue},
|
| 310 |
+
}
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
---
|
| 314 |
+
|
| 315 |
+
© 2026 Desert Ant Labs · <https://desertant.com>
|
| 316 |
+
<!-- card-footer:end -->
|
THIRD_PARTY_NOTICES.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Third-party notices — tongue
|
| 2 |
+
|
| 3 |
+
tongue is trained from scratch and does not derive from any third-party model.
|
| 4 |
+
The training and evaluation corpora below are licensed by their respective
|
| 5 |
+
projects, and those licenses apply to that data. Nothing in the Desert Ant Labs
|
| 6 |
+
Source-Available License overrides them.
|
| 7 |
+
|
| 8 |
+
Every source used for training is CC0, CC BY, or a permissive software license.
|
| 9 |
+
Share-alike and non-commercial sources are excluded by policy, and the corpus
|
| 10 |
+
build enforces the exclusion and records a provenance manifest of every file
|
| 11 |
+
kept and dropped.
|
| 12 |
+
|
| 13 |
+
## Training data
|
| 14 |
+
|
| 15 |
+
### Tatoeba — sentence and link exports
|
| 16 |
+
- **Source:** [tatoeba.org](https://tatoeba.org) — `downloads.tatoeba.org/exports/`
|
| 17 |
+
- **License:** CC BY 2.0 FR
|
| 18 |
+
- **Attribution:** © Tatoeba contributors, licensed under CC BY 2.0 FR
|
| 19 |
+
- **Use in tongue:** the primary corpus. Sentences are windowed into 1–5 and
|
| 20 |
+
8-word spans, and their distinct tokens supply single-word training rows. The
|
| 21 |
+
translation-link graph is used to split train/validation by translation family
|
| 22 |
+
so a sentence and its translations cannot straddle the split.
|
| 23 |
+
|
| 24 |
+
### Common Voice — sentence collections
|
| 25 |
+
- **Source:** [common-voice/common-voice](https://github.com/common-voice/common-voice) (`server/data`)
|
| 26 |
+
- **License:** CC0 1.0
|
| 27 |
+
- **Use in tongue:** additional sentence-register text, strongest for languages
|
| 28 |
+
where Tatoeba is thin (Catalan, Basque, Galician, Welsh, Swahili, Belarusian).
|
| 29 |
+
- **Exclusions:** files derived from Wikipedia or Europarl are **not** used, as
|
| 30 |
+
their upstream sources are share-alike. The fetcher drops any file matching
|
| 31 |
+
`*wiki*` or `*europarl*` and writes the resulting keep/drop manifest.
|
| 32 |
+
|
| 33 |
+
### Wikidata Lexemes
|
| 34 |
+
- **Source:** [wikidata.org](https://www.wikidata.org) lexeme dumps
|
| 35 |
+
- **License:** CC0 1.0
|
| 36 |
+
- **Use in tongue:** dictionary-register vocabulary rows (single words).
|
| 37 |
+
|
| 38 |
+
### Hunspell dictionaries
|
| 39 |
+
- **Source:** [wooorm/dictionaries](https://github.com/wooorm/dictionaries) — English, Dutch, Lithuanian, Russian, Turkish, Persian
|
| 40 |
+
- **License:** per dictionary (MIT / BSD / Apache-2.0 and similar permissive terms; see each dictionary's own license file)
|
| 41 |
+
- **Use in tongue:** additional clean single-word vocabulary for those six languages.
|
| 42 |
+
|
| 43 |
+
### Universal Dependencies treebanks
|
| 44 |
+
- **Source:** [universaldependencies.org](https://universaldependencies.org)
|
| 45 |
+
- **License:** CC BY 4.0 (attribution required), verified per treebank
|
| 46 |
+
- **Treebanks used:** UD_Spanish-AnCora, UD_Catalan-AnCora, UD_Finnish-FTB,
|
| 47 |
+
UD_Italian-MarkIT, UD_Portuguese-Porttinari
|
| 48 |
+
- **Use in tongue:** written-register sentences (news, reviews), taken from the
|
| 49 |
+
`# text =` lines. Share-alike and non-commercial UD treebanks are excluded.
|
| 50 |
+
|
| 51 |
+
## Evaluation only — never used for training
|
| 52 |
+
|
| 53 |
+
- **FLORES-200** — NLLB Team et al. — CC BY-SA 4.0 — held out; used for the
|
| 54 |
+
neutral truncation benchmark.
|
| 55 |
+
- **WiLI-2018** — ODC-BY 1.0 — held out; tail-language coverage check.
|
| 56 |
+
- **eld benchmark** — [nitotm/efficient-language-detector](https://github.com/nitotm/efficient-language-detector) — Apache-2.0 — held out; independent generalization check.
|
| 57 |
+
|
| 58 |
+
These sets are used to measure the model and are never part of the training
|
| 59 |
+
corpus. Leipzig / Wortschatz corpora are excluded from training in every form
|
| 60 |
+
(news, web, wiki, frequency lists, and mirrors), because another detector's
|
| 61 |
+
published test set is drawn from that collection and training on it would make
|
| 62 |
+
comparisons meaningless.
|
| 63 |
+
|
| 64 |
+
## Comparison baselines
|
| 65 |
+
|
| 66 |
+
Numbers reported alongside tongue were produced by running these systems on the
|
| 67 |
+
identical rows and language subsets. They are not redistributed here.
|
| 68 |
+
|
| 69 |
+
- **lingua** ([pemistahl/lingua-py](https://github.com/pemistahl/lingua-py)) — Apache-2.0
|
| 70 |
+
- **eld** ([nitotm/efficient-language-detector](https://github.com/nitotm/efficient-language-detector)) — Apache-2.0
|
| 71 |
+
- **HeLI-OTS** — [University of Helsinki](https://zenodo.org/record/841984) — used as published
|
| 72 |
+
- **Apple `NLLanguageRecognizer`** — the operating-system detector, measured through a Swift harness
|
labels.json
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_labels": {
|
| 3 |
+
"en": "English",
|
| 4 |
+
"es": "Spanish",
|
| 5 |
+
"pt": "Portuguese",
|
| 6 |
+
"fr": "French",
|
| 7 |
+
"de": "German",
|
| 8 |
+
"it": "Italian",
|
| 9 |
+
"nl": "Dutch",
|
| 10 |
+
"pl": "Polish",
|
| 11 |
+
"tr": "Turkish",
|
| 12 |
+
"sv": "Swedish",
|
| 13 |
+
"da": "Danish",
|
| 14 |
+
"no": "Norwegian",
|
| 15 |
+
"fi": "Finnish",
|
| 16 |
+
"cs": "Czech",
|
| 17 |
+
"ro": "Romanian",
|
| 18 |
+
"hu": "Hungarian",
|
| 19 |
+
"id": "Indonesian",
|
| 20 |
+
"vi": "Vietnamese",
|
| 21 |
+
"ca": "Catalan",
|
| 22 |
+
"hr": "Croatian",
|
| 23 |
+
"sk": "Slovak",
|
| 24 |
+
"lt": "Lithuanian",
|
| 25 |
+
"et": "Estonian",
|
| 26 |
+
"af": "Afrikaans",
|
| 27 |
+
"eu": "Basque",
|
| 28 |
+
"gl": "Galician",
|
| 29 |
+
"is": "Icelandic",
|
| 30 |
+
"tl": "Tagalog",
|
| 31 |
+
"ms": "Malay",
|
| 32 |
+
"az": "Azerbaijani",
|
| 33 |
+
"sl": "Slovenian",
|
| 34 |
+
"sw": "Swahili",
|
| 35 |
+
"ga": "Irish",
|
| 36 |
+
"sq": "Albanian",
|
| 37 |
+
"cy": "Welsh",
|
| 38 |
+
"lv": "Latvian",
|
| 39 |
+
"eo": "Esperanto",
|
| 40 |
+
"la": "Latin",
|
| 41 |
+
"ku": "Kurdish",
|
| 42 |
+
"yo": "Yoruba",
|
| 43 |
+
"xh": "Xhosa",
|
| 44 |
+
"st": "Sotho",
|
| 45 |
+
"ru": "Russian",
|
| 46 |
+
"uk": "Ukrainian",
|
| 47 |
+
"bg": "Bulgarian",
|
| 48 |
+
"sr": "Serbian",
|
| 49 |
+
"mk": "Macedonian",
|
| 50 |
+
"be": "Belarusian",
|
| 51 |
+
"kk": "Kazakh",
|
| 52 |
+
"ky": "Kyrgyz",
|
| 53 |
+
"ar": "Arabic",
|
| 54 |
+
"fa": "Persian",
|
| 55 |
+
"ug": "Uyghur",
|
| 56 |
+
"ur": "Urdu",
|
| 57 |
+
"hi": "Hindi",
|
| 58 |
+
"mr": "Marathi",
|
| 59 |
+
"ne": "Nepali",
|
| 60 |
+
"bn": "Bengali",
|
| 61 |
+
"as": "Assamese"
|
| 62 |
+
},
|
| 63 |
+
"script_decided": {
|
| 64 |
+
"am": "Amharic",
|
| 65 |
+
"bo": "Tibetan",
|
| 66 |
+
"chr": "Cherokee",
|
| 67 |
+
"dv": "Dhivehi",
|
| 68 |
+
"el": "Greek",
|
| 69 |
+
"gu": "Gujarati",
|
| 70 |
+
"he": "Hebrew",
|
| 71 |
+
"hy": "Armenian",
|
| 72 |
+
"ja": "Japanese",
|
| 73 |
+
"ka": "Georgian",
|
| 74 |
+
"km": "Khmer",
|
| 75 |
+
"kn": "Kannada",
|
| 76 |
+
"ko": "Korean",
|
| 77 |
+
"lo": "Lao",
|
| 78 |
+
"ml": "Malayalam",
|
| 79 |
+
"mn": "Mongolian",
|
| 80 |
+
"my": "Burmese",
|
| 81 |
+
"or": "Odia",
|
| 82 |
+
"pa": "Punjabi",
|
| 83 |
+
"si": "Sinhala",
|
| 84 |
+
"syr": "Syriac",
|
| 85 |
+
"ta": "Tamil",
|
| 86 |
+
"te": "Telugu",
|
| 87 |
+
"th": "Thai",
|
| 88 |
+
"zh": "Chinese"
|
| 89 |
+
},
|
| 90 |
+
"native_names": {
|
| 91 |
+
"en": "English",
|
| 92 |
+
"es": "Español",
|
| 93 |
+
"pt": "Português",
|
| 94 |
+
"fr": "Français",
|
| 95 |
+
"de": "Deutsch",
|
| 96 |
+
"it": "Italiano",
|
| 97 |
+
"nl": "Nederlands",
|
| 98 |
+
"pl": "Polski",
|
| 99 |
+
"tr": "Türkçe",
|
| 100 |
+
"sv": "Svenska",
|
| 101 |
+
"da": "Dansk",
|
| 102 |
+
"no": "Norsk",
|
| 103 |
+
"fi": "Suomi",
|
| 104 |
+
"cs": "Čeština",
|
| 105 |
+
"ro": "Română",
|
| 106 |
+
"hu": "Magyar",
|
| 107 |
+
"id": "Indonesia",
|
| 108 |
+
"vi": "Tiếng Việt",
|
| 109 |
+
"ca": "Català",
|
| 110 |
+
"hr": "Hrvatski",
|
| 111 |
+
"sk": "Slovenčina",
|
| 112 |
+
"lt": "Lietuvių",
|
| 113 |
+
"et": "Eesti",
|
| 114 |
+
"af": "Afrikaans",
|
| 115 |
+
"eu": "Euskara",
|
| 116 |
+
"gl": "Galego",
|
| 117 |
+
"is": "Íslenska",
|
| 118 |
+
"tl": "Tagalog",
|
| 119 |
+
"ms": "Melayu",
|
| 120 |
+
"az": "Azərbaycan",
|
| 121 |
+
"sl": "Slovenščina",
|
| 122 |
+
"sw": "Kiswahili",
|
| 123 |
+
"ga": "Gaeilge",
|
| 124 |
+
"sq": "Shqip",
|
| 125 |
+
"cy": "Cymraeg",
|
| 126 |
+
"lv": "Latviešu",
|
| 127 |
+
"eo": "Esperanto",
|
| 128 |
+
"la": "Latina",
|
| 129 |
+
"ku": "Kurdî",
|
| 130 |
+
"yo": "Yorùbá",
|
| 131 |
+
"xh": "isiXhosa",
|
| 132 |
+
"st": "Sesotho",
|
| 133 |
+
"ru": "Русский",
|
| 134 |
+
"uk": "Українська",
|
| 135 |
+
"bg": "Български",
|
| 136 |
+
"sr": "Српски",
|
| 137 |
+
"mk": "Македонски",
|
| 138 |
+
"be": "Беларуская",
|
| 139 |
+
"kk": "Қазақ",
|
| 140 |
+
"ky": "Кыргыз",
|
| 141 |
+
"ar": "العربية",
|
| 142 |
+
"fa": "فارسی",
|
| 143 |
+
"ug": "ئۇيغۇر",
|
| 144 |
+
"ur": "اردو",
|
| 145 |
+
"hi": "हिन्दी",
|
| 146 |
+
"mr": "मराठी",
|
| 147 |
+
"ne": "नेपाली",
|
| 148 |
+
"bn": "বাংলা",
|
| 149 |
+
"as": "অসমীয়া",
|
| 150 |
+
"am": "አማርኛ",
|
| 151 |
+
"bo": "བོད",
|
| 152 |
+
"chr": "ᏣᎳᎩ",
|
| 153 |
+
"dv": "ދިވެހި",
|
| 154 |
+
"el": "Ελληνικά",
|
| 155 |
+
"gu": "ગુજરાતી",
|
| 156 |
+
"he": "עברית",
|
| 157 |
+
"hy": "Հայերեն",
|
| 158 |
+
"ja": "日本語",
|
| 159 |
+
"ka": "ქართული",
|
| 160 |
+
"km": "ខ្មែរ",
|
| 161 |
+
"kn": "ಕನ್ನಡ",
|
| 162 |
+
"ko": "한국어",
|
| 163 |
+
"lo": "ລາວ",
|
| 164 |
+
"ml": "മലയാളം",
|
| 165 |
+
"mn": "Монгол",
|
| 166 |
+
"my": "မြန်မာ",
|
| 167 |
+
"or": "ଓଡ଼ିଆ",
|
| 168 |
+
"pa": "ਪੰਜਾਬੀ",
|
| 169 |
+
"si": "සිංහල",
|
| 170 |
+
"syr": "ܣܘܪܝܝܐ",
|
| 171 |
+
"ta": "தமிழ்",
|
| 172 |
+
"te": "తెలుగు",
|
| 173 |
+
"th": "ไทย",
|
| 174 |
+
"zh": "中文"
|
| 175 |
+
}
|
| 176 |
+
}
|
tongue.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:22e3d33efa6b0cf4c75401e3f5becb243ef5a4256d48d8b399e56eb62471359e
|
| 3 |
+
size 8399496
|
tongue_int4.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8067e66bca3b254f41265d020d87f98127469d6f29101fb627f7c40e5414c4d
|
| 3 |
+
size 1056492
|
tongue_int8.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2cea7b6a92be043c58596d0b6f482fbc27fb901e5697d77159247d3ec6bdf767
|
| 3 |
+
size 2104940
|
tongue_meta.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"labels": [
|
| 3 |
+
"en",
|
| 4 |
+
"es",
|
| 5 |
+
"pt",
|
| 6 |
+
"fr",
|
| 7 |
+
"de",
|
| 8 |
+
"it",
|
| 9 |
+
"nl",
|
| 10 |
+
"pl",
|
| 11 |
+
"tr",
|
| 12 |
+
"sv",
|
| 13 |
+
"da",
|
| 14 |
+
"no",
|
| 15 |
+
"fi",
|
| 16 |
+
"cs",
|
| 17 |
+
"ro",
|
| 18 |
+
"hu",
|
| 19 |
+
"id",
|
| 20 |
+
"vi",
|
| 21 |
+
"ca",
|
| 22 |
+
"hr",
|
| 23 |
+
"sk",
|
| 24 |
+
"lt",
|
| 25 |
+
"et",
|
| 26 |
+
"af",
|
| 27 |
+
"eu",
|
| 28 |
+
"gl",
|
| 29 |
+
"is",
|
| 30 |
+
"tl",
|
| 31 |
+
"ms",
|
| 32 |
+
"az",
|
| 33 |
+
"sl",
|
| 34 |
+
"sw",
|
| 35 |
+
"ga",
|
| 36 |
+
"sq",
|
| 37 |
+
"cy",
|
| 38 |
+
"lv",
|
| 39 |
+
"eo",
|
| 40 |
+
"la",
|
| 41 |
+
"ku",
|
| 42 |
+
"yo",
|
| 43 |
+
"xh",
|
| 44 |
+
"st",
|
| 45 |
+
"ru",
|
| 46 |
+
"uk",
|
| 47 |
+
"bg",
|
| 48 |
+
"sr",
|
| 49 |
+
"mk",
|
| 50 |
+
"be",
|
| 51 |
+
"kk",
|
| 52 |
+
"ky",
|
| 53 |
+
"ar",
|
| 54 |
+
"fa",
|
| 55 |
+
"ug",
|
| 56 |
+
"ur",
|
| 57 |
+
"hi",
|
| 58 |
+
"mr",
|
| 59 |
+
"ne",
|
| 60 |
+
"bn",
|
| 61 |
+
"as"
|
| 62 |
+
],
|
| 63 |
+
"num_buckets": 65536,
|
| 64 |
+
"dim": 32,
|
| 65 |
+
"ngram_orders": [
|
| 66 |
+
1,
|
| 67 |
+
2,
|
| 68 |
+
3,
|
| 69 |
+
4,
|
| 70 |
+
5
|
| 71 |
+
],
|
| 72 |
+
"whole_tokens": false,
|
| 73 |
+
"embed_scale": 0.06248359229620986,
|
| 74 |
+
"layout": {
|
| 75 |
+
"emb_int8": [
|
| 76 |
+
65536,
|
| 77 |
+
32
|
| 78 |
+
],
|
| 79 |
+
"lin_w_f32": [
|
| 80 |
+
59,
|
| 81 |
+
32
|
| 82 |
+
],
|
| 83 |
+
"lin_b_f32": [
|
| 84 |
+
59
|
| 85 |
+
]
|
| 86 |
+
},
|
| 87 |
+
"latin_labels": [
|
| 88 |
+
"en",
|
| 89 |
+
"es",
|
| 90 |
+
"pt",
|
| 91 |
+
"fr",
|
| 92 |
+
"de",
|
| 93 |
+
"it",
|
| 94 |
+
"nl",
|
| 95 |
+
"pl",
|
| 96 |
+
"tr",
|
| 97 |
+
"sv",
|
| 98 |
+
"da",
|
| 99 |
+
"no",
|
| 100 |
+
"fi",
|
| 101 |
+
"cs",
|
| 102 |
+
"ro",
|
| 103 |
+
"hu",
|
| 104 |
+
"id",
|
| 105 |
+
"vi",
|
| 106 |
+
"ca",
|
| 107 |
+
"hr",
|
| 108 |
+
"sk",
|
| 109 |
+
"lt",
|
| 110 |
+
"et",
|
| 111 |
+
"af",
|
| 112 |
+
"eu",
|
| 113 |
+
"gl",
|
| 114 |
+
"is",
|
| 115 |
+
"tl",
|
| 116 |
+
"ms",
|
| 117 |
+
"az",
|
| 118 |
+
"sl",
|
| 119 |
+
"sw",
|
| 120 |
+
"ga",
|
| 121 |
+
"sq",
|
| 122 |
+
"cy",
|
| 123 |
+
"lv",
|
| 124 |
+
"eo",
|
| 125 |
+
"la",
|
| 126 |
+
"ku",
|
| 127 |
+
"yo",
|
| 128 |
+
"xh",
|
| 129 |
+
"st"
|
| 130 |
+
],
|
| 131 |
+
"script_decisive": {
|
| 132 |
+
"Hangul": "ko",
|
| 133 |
+
"Hiragana": "ja",
|
| 134 |
+
"Katakana": "ja",
|
| 135 |
+
"Thai": "th",
|
| 136 |
+
"Lao": "lo",
|
| 137 |
+
"Khmer": "km",
|
| 138 |
+
"Myanmar": "my",
|
| 139 |
+
"Greek": "el",
|
| 140 |
+
"Hebrew": "he",
|
| 141 |
+
"Armenian": "hy",
|
| 142 |
+
"Georgian": "ka",
|
| 143 |
+
"Ethiopic": "am",
|
| 144 |
+
"Cherokee": "chr",
|
| 145 |
+
"Tamil": "ta",
|
| 146 |
+
"Telugu": "te",
|
| 147 |
+
"Kannada": "kn",
|
| 148 |
+
"Malayalam": "ml",
|
| 149 |
+
"Sinhala": "si",
|
| 150 |
+
"Gujarati": "gu",
|
| 151 |
+
"Gurmukhi": "pa",
|
| 152 |
+
"Oriya": "or",
|
| 153 |
+
"Thaana": "dv",
|
| 154 |
+
"Tibetan": "bo",
|
| 155 |
+
"Mongolian": "mn",
|
| 156 |
+
"Syriac": "syr",
|
| 157 |
+
"Han": "zh"
|
| 158 |
+
},
|
| 159 |
+
"script_narrowing": {
|
| 160 |
+
"Cyrillic": [
|
| 161 |
+
"ru",
|
| 162 |
+
"uk",
|
| 163 |
+
"bg",
|
| 164 |
+
"sr",
|
| 165 |
+
"mk",
|
| 166 |
+
"be",
|
| 167 |
+
"kk",
|
| 168 |
+
"ky"
|
| 169 |
+
],
|
| 170 |
+
"Arabic": [
|
| 171 |
+
"ar",
|
| 172 |
+
"fa",
|
| 173 |
+
"ur",
|
| 174 |
+
"ug"
|
| 175 |
+
],
|
| 176 |
+
"Devanagari": [
|
| 177 |
+
"hi",
|
| 178 |
+
"mr",
|
| 179 |
+
"ne"
|
| 180 |
+
],
|
| 181 |
+
"Bengali": [
|
| 182 |
+
"bn",
|
| 183 |
+
"as"
|
| 184 |
+
]
|
| 185 |
+
},
|
| 186 |
+
"normalization": "NFC, lowercase, strip URLs/emails/mentions/digits, collapse whitespace, cap 512 chars",
|
| 187 |
+
"hashing": "FNV-1a 32-bit over Unicode scalars of '^token$', n-gram orders as listed, modulo num_buckets",
|
| 188 |
+
"onnx": {
|
| 189 |
+
"file": "tongue.onnx",
|
| 190 |
+
"inputs": {
|
| 191 |
+
"values": "int64[num_ngrams] — fnv1a(ngram) % num_buckets, flat over the batch",
|
| 192 |
+
"offsets": "int64[batch] — start index of each sample within values"
|
| 193 |
+
},
|
| 194 |
+
"output": "logits float32[batch, num_labels] in `labels` order",
|
| 195 |
+
"note": "head only; normalization, hashing and script routing run in the host"
|
| 196 |
+
}
|
| 197 |
+
}
|