/ Модель

Характеристики

Лицензия
Своя лицензия
Опубликована
25 июл 2026

tongue

Классификация текстаТекст → label5 профессий

Tongue — компактная модель Desert Ant Labs для локального определения языка коротких текстов на 84 языках.

0скачиваний за 30 дней16лайковвеса обновлены25 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Tongue — компактная модель Desert Ant Labs для определения языка короткого текста на устройстве. Она классифицирует текст по первым трём словам и предназначена для строк поиска, сообщений чата и ввода с клавиатуры. Модель охватывает 84 языка и 31 письменность: лексическая часть обучена для 59 языков, а ещё 25 распознаются по письменности. Для монгольского поддерживается только традиционное письмо.

Основная поставка использует веса int8 размером около 2 МБ; также доступны сборка int4 примерно на 1 МБ и граф ONNX в формате fp32. Токенизатор и файл словаря не требуются. SDK поддерживают iOS, macOS, tvOS, visionOS, Android, Linux, Windows, браузер и Node.js; README указывает время обнаружения в десятки микросекунд. На вход подаётся короткая строка UTF-8, обрабатываются первые 512 символов; результат — ранжированные коды языков ISO 639-1/639-3 с вероятностями и оценкой надёжности. Для неоднозначных фраз модель может вернуть несколько вариантов или осторожный ответ.

Tongue предназначена для локальной идентификации языка и не является моделью общего назначения. Точность зависит от длины и однозначности текста: короткие фразы могут одинаково подходить нескольким языкам, а языки, распознаваемые только по письменности, не получают лексической классификации. Лицензия в метаданных обозначена как other; подробные условия использования в предоставленных материалах не раскрыты.

Сценарии применения

  • определение языка запроса в строке поиска
  • определение языка короткого сообщения в чате
  • распознавание языка текста, введённого с клавиатуры
  • автоматический выбор языка интерфейса или обработки текста
  • определение языка короткой фразы в браузере или мобильном приложении

Ограничения

Короткие и распространённые фразы могут быть неоднозначны, поэтому модель иногда возвращает несколько языков или осторожный результат. Для монгольского распознаётся только традиционная письменность; первые 512 символов — предел обрабатываемого текста.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Tongue

Detect language based on 3 words.

On-device language identification for short text across 84 languages.

PlatformsiOS, macOS, tvOS, visionOS, Android, Linux, Windows, Browser, Node
Languages84
WeightsBundled with the SDK (v1.0.0)
Demohttps://desertant.com/models/tongue/

Name the language from three words, across 84 languages. Tongue is built for where detection is hardest and most useful on a device: search boxes, chat messages, keyboard input. The model is 2MB of int8 weights with no tokenizer and no vocabulary file, ships inside the SDK, and a detection takes tens of microseconds.

"kann ich das haben" → German · "안녕하세요" → Korean · "привет как дела" → Russian · "quanto costa il biglietto" → Italian

On genuinely ambiguous input, Tongue says so rather than guessing: "la casa" comes back as Italian or Spanish, because the phrase is equally both.

Try it

Install

Swift (requirements)

.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core.git", from: "6.0.0")

Then add the Tongue product to your target.

Kotlin (requirements)

implementation(platform("ai.desertant:bom:6.0.0"))
implementation("ai.desertant:tongue")

JavaScript (requirements)

npm i @desert-ant-labs/tongue

Usage

Tongue needs no download. The 2MB model ships inside the package. Tongue needs no inference runtime, so detect is synchronous and you call it without await.

Swift

import Tongue

let tongue = try Tongue()                      // loads the bundled 2MB model
let detection = tongue.detect("kann ich das haben")

detection.language          // "de"
detection.reliability       // .confident
detection.candidates        // [Prediction(language: "de", probability: 0.999…), …]
detection.isTooCloseToCall  // false

Kotlin

Tongue has no native code, so you can use Tongue on Android or on any JVM 17+.

import ai.desertant.tongue.Tongue

// Android: pass the Context. On a bare JVM pass null: Tongue.bundled(null).
val tongue = Tongue.bundled(context)
val detection = tongue.detect("kann ich das haben")
detection.language                               // "de"
detection.isTooCloseToCall                       // false

An app in production sets its API key once, before the first load. An Android app needs the INTERNET permission, and passes the Context so Tongue can keep its license. On a JVM server, also set a device id secret and pass the device id of the end user's device with each call. The server guide has the details.

On a JVM, Tongue keeps its install id and its license in the file tongue.properties. The folder is DAL_STATE_DIR when you set it. If not, it is $XDG_CONFIG_HOME/desert-ant, or ~/.config/desert-ant. The file holds your API key in plain text, as part of a storage key. On macOS and Linux, only the user that owns the process can read it. On Windows, the file has the permissions of its folder, so point DAL_STATE_DIR at a folder only that user can read. When Tongue cannot write the file, it keeps the license in memory and logs one warning.

import ai.desertant.tongue.DesertAnt

DesertAnt.configure(apiKey, deviceIdSecret)      // on a server; in an app: DesertAnt.configure(apiKey)
val tongue = Tongue.bundled(null)                // on a server; in an app: Tongue.bundled(context)
tongue.detect(text, request.deviceId)
tongue.flushLicenses()                           // before a short-lived process exits; it blocks

JavaScript

The JavaScript SDK uses the same import in the browser and in Node. Tongue is plain JavaScript, so you install only @desert-ant-labs/tongue.

import { Tongue } from "@desert-ant-labs/tongue";

const tongue = await Tongue.load();                    // Node: reads the bundled model
const detection = tongue.detect("kann ich das haben");
detection.language;                                    // "de"
detection.isTooCloseToCall;                            // false

A bundler doesn't serve files out of node_modules, so in a browser you serve Tongue's two model files yourself. The package exports tongue_int8.bin and tongue_meta.json as subpaths, so a copy script can find them with require.resolve, under pnpm and Yarn PnP too. Pass the folder you serve them from as from:

const tongue = await Tongue.load({ from: "/models/tongue" });

An app in production sets its API key once, before the first load. On a server, also set a device id secret and pass the device id of the end user's device with each call. The server guide has the details.

import { DesertAnt, Tongue } from "@desert-ant-labs/tongue";

// On a server. In a browser: DesertAnt.configure({ apiKey }).
DesertAnt.configure({ apiKey: process.env.DAL_API_KEY ?? "", deviceIdSecret: process.env.DAL_DEVICE_ID_SECRET });
const tongue = await Tongue.load();
tongue.detect(text, { deviceId: request.deviceId });
await tongue.flushLicenses();                          // before a short-lived process exits

In Node, Tongue keeps its install id and its license in the file tongue.json, so a new process asks for no new license. The file is in the folder that DAL_STATE_DIR names. Without DAL_STATE_DIR, the folder is $XDG_CONFIG_HOME/desert-ant, or ~/.config/desert-ant when XDG_CONFIG_HOME is not set. On Windows it is %APPDATA%\desert-ant. The file holds your API key in plain text, as part of a storage key. On macOS and Linux, only the user that owns the process can read it. On Windows, the file has the permissions of its folder, so point DAL_STATE_DIR at a folder only that user can read. If Tongue cannot write the file, it keeps both in memory, logs one warning, and the model keeps running. In a browser, both are in localStorage.

Files

FileFormatSizeContents
tongue_int8.binRaw int8 + fp322.01MiBThe model the SDKs load.
tongue_int4.binRaw int4 + fp321.01MiBA half-size build for tight bundles. See Sizes.
tongue.onnxONNX (fp32, opset 17)8.4MBPortable graph for onnxruntime and onnxruntime-web.
tongue_meta.jsonJSONtinyRuntime tables: label order, hashing constants, script routing.
labels.jsonJSONtinyThe 59 model labels plus the script-decided languages, with English and native names.

Inputs and outputs

Pass a short UTF-8 string. Tongue reads only the first 512 characters. You get ranked ISO 639-1/639-3 codes with probabilities, plus a reliability signal: confident, likely or tentative. For a language Tongue decides by script, you get a single confident answer.

The ONNX graph holds only the classification head. The graph reads values (int64 hashed bucket ids) and offsets (int64 per-sample starts), and produces logits. Your host code runs normalization, hashing and script routing before the graph. tongue_meta.json documents those steps.

Coverage

Tongue covers 84 languages across 31 scripts, among them Latin, Cyrillic, Arabic, Greek and the CJK and Indic families. We trained the lexical model on 59 of the languages. Tongue identifies the other 25 by script alone. Tongue detects one of the 84, Mongolian, only in the traditional Mongolian script. See failure mode 3.

Sizes

The Hugging Face repo holds two quantizations of the same weights. The SDKs bundle the int8 build.

tongue_int8.bintongue_int4.bin
Size2.01MiB1.01MiB
FLORES 2-word0.8690.866
FLORES 5-word0.9740.973
Held-out single words0.7590.752
Held-out sentences0.9710.970

The int4 build loses almost all of its accuracy on one- and two-word input. Full sentences are unaffected within measurement noise. Short text is what Tongue is for, so int8 is the default, and int4 is the option when a megabyte matters more than the last half point.

Failure modes

  1. One or two words are often genuinely ambiguous, and no model size fixes that. A single common word often belongs to several languages at once. "sale" is English, French and Italian, and "la casa" is equally Italian and Spanish. Tongue reports a tie or a tentative answer in these cases. Tongue doesn't catch every case. A phrase that mixes languages, like "un garage sale", can still get a single answer that looks confident. Treat low-reliability output as unknown, and ask for more text where your product allows it.
  2. Tongue can't reliably tell Malay and Indonesian apart. The two languages share so much vocabulary and spelling that short samples carry nothing to separate them. Every detector we measured struggles with the pair. If you need the distinction, treat ms and id as one bucket, or decide from the user's locale.
  3. Tongue detects Mongolian only in the traditional Mongolian script. Cyrillic is the dominant modern script for Mongolian. Tongue doesn't tell Cyrillic Mongolian apart from the other Cyrillic languages, and usually returns Russian for it. Don't rely on Tongue for Cyrillic Mongolian.
  4. Brand names, numbers and code have no language. "Samsung Galaxy", "v1.2.3" and "2024 annual report" have no correct answer. Tongue still returns its best guess for anything with letters in it. Filter out input that isn't prose before detection.
  5. Single-word scores mostly measure vocabulary recognition, and say less about generalization. The frequent words of a language appear in every detector's training data, so single-word accuracy partly measures memorized vocabulary. Read the word-pair and sentence numbers as the generalization signal.

Measured quality

We measured every number below on the shipped int8 weights, on three public benchmarks. We ran the other detectors on the same rows and languages. For every score, higher is better.

FLORES-200

We truncated FLORES-200 sentences to their first 2, 3 and 5 words. The table shows accuracy over the 20 languages the three detectors share.

DetectorSize2 words3 words5 words
tongue2MB0.8690.9330.974
lingua293MB0.8000.8870.956
eld1MB0.7800.8560.912

The lingua test set

lingua publishes this benchmark. The set holds 1,000 single words, word pairs and sentences per language, drawn from the same collection lingua trains on. The table shows accuracy over the languages Tongue and lingua share.

DetectorSizeSingle wordsWord pairsSentences
tongue2MB0.7460.9090.988
lingua293MB0.7520.9150.985

The eld benchmark

eld is an independent benchmark. The table shows accuracy over the languages Tongue supports: 53,035 single-word rows, 53,613 word pairs, 53,141 sentences and 9,066 tweets. Apple is the built-in system detector on Apple platforms. HeLI-OTS is a 51MB JVM model. lingua 2.2.0 installs as a single 293MB compiled extension with its language models embedded.

DetectorSizeTweetsSingle wordsWord pairsSentences
tongue2MB0.9920.7590.8870.971
lingua293MB0.9840.7560.8940.950
HeLI-OTS51MB0.9860.6830.8430.967
Applesystem0.9970.6410.7190.748

Latency

We timed single detections in JavaScript on an Apple silicon laptop. One word takes 0.013ms. A short sentence takes 0.028ms. A 193-character input takes 0.10ms, with a p99 of 0.24ms. Phones will take longer. The design target is under 1ms.

License

Desert Ant Labs Source-Available License. Free for most apps, and a commercial license is required at scale. Full terms are at the link. Licensing: licensing@desertant.com.

Third-party notices for the weights: THIRD_PARTY_NOTICES.md.

Citation

@software{tongue_2026,
  title  = {Tongue: On-device language identification for short text across 84 languages},
  author = {Desert Ant Labs},
  year   = {2026},
  url    = {https://huggingface.co/desert-ant-labs/tongue},
}

© 2026 Desert Ant Labs · https://desertant.com

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
12163e6

0 моделей