This release is a pre-release and may not be stable for production use.
ovos-lang-detect-plugin-linguonnx
An OVOS language-detection plugin. It wraps
linguonnx, which runs the
TigreGotico/glotlid-onnx
export of GlotLID on onnxruntime, CPU-only, no torch.
Install
pip install ovos-lang-detect-plugin-linguonnx
The model downloads from HuggingFace on first use and is cached under
~/.cache/linguonnx/models/<model_id>/. Constructing the plugin does not
trigger this download; it happens on the first call to detect,
detect_probs, or available_languages.
Configuration
{
"language_detection": {
"module": "ovos-lang-detect-plugin-linguonnx",
"ovos-lang-detect-plugin-linguonnx": {
"model": "glotlid-int8",
"collapse_varieties": true,
"min_confidence": 0.0,
"lang": "en-US"
}
}
}
model:"glotlid-int8"(default, quantized, 419 MB) or"glotlid"(fp32, 1.68 GB). Both cover the same 2102 GlotLID labels; the int8 model has no measured accuracy loss, so there is no reason to prefer the fp32 one unless you need it for some other purpose.collapse_varieties: see below.min_confidence: if the model's top confidence is below this,detect()returnsself.config.get("lang", "en-US")instead of the detected tag. Default0.0, meaning no fallback ever triggers.lang: the fallback tag used whenmin_confidenceisn't met. Default"en-US".
Language varieties
GlotLID identifies individual language varieties, not macrolanguages.
Casual Arabic text comes back as e.g. ajp-Arab (South Levantine) rather
than ar, and some Chinese text comes back as yue-Hani (Cantonese)
rather than zh.
linguonnx itself defaults to reporting these varieties as-is, since that
fine-grained answer is useful on its own (free dialect identification).
This plugin flips the default to collapse varieties onto their
macrolanguage (ajp-Arab -> ar), because the two things OVOS actually
does with a detected language tag - picking a TTS voice, picking a
translation target - only know macrolanguages. A caller getting
ajp-Arab back from a pipeline that only ships ar voices would read it
as unsupported.
Set collapse_varieties: false in the plugin config to get linguonnx's
native per-variety fidelity instead.
Credits
- linguonnx - the detection engine this plugin wraps.
- TigreGotico/glotlid-onnx -
the ONNX export of GlotLID that
linguonnxruns.
Metadata
Release files for ovos-lang-detect-plugin-linguonnx 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ovos_lang_detect_plugin_linguonnx-0.1.0a1.tar.gz | 8.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ovos_lang_detect_plugin_linguonnx-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.4 kB
Release files / ovos_lang_detect_plugin_linguonnx-0.1.0a1.tar.gz
| Download URL | ovos_lang_detect_plugin_linguonnx-0.1.0a1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e44b5d38618fae7f642916f4b682ad1046275198ebf8e16facf798d385499f0
|
|
BLAKE2b-256 checksum How to use checksums |
b09f85abfddec6ccdf273f15329938c20c7344c70b20ae0d77e5a4fdc7beda11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / ovos_lang_detect_plugin_linguonnx-0.1.0a1-py3-none-any.whl
| Download URL | ovos_lang_detect_plugin_linguonnx-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
167507d3de84828cb22e3187f1f1acfe79785830676c0c7080b4ceef8e8172cd
|
|
BLAKE2b-256 checksum How to use checksums |
b621cd33c5860d75b11ea224c01412b98ed26b53db29079b1265d4cef576891a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|