Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-lang-detect-plugin-lingonnx

An OVOS language-detection plugin. It wraps lingonnx, which runs the TigreGotico/glotlid-onnx export of GlotLID on onnxruntime, CPU-only, no torch.

Install

pip install ovos-lang-detect-plugin-lingonnx

The model downloads from HuggingFace on first use and is cached under ~/.cache/lingonnx/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-lingonnx",
    "ovos-lang-detect-plugin-lingonnx": {
      "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() returns self.config.get("lang", "en-US") instead of the detected tag. Default 0.0, meaning no fallback ever triggers.
  • lang: the fallback tag used when min_confidence isn'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.

lingonnx 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 lingonnx's native per-variety fidelity instead.

Credits

Metadata

Release files for ovos-lang-detect-plugin-lingonnx 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-lang-detect-plugin-lingonnx 0.1.0a1
File Size Uploaded
ovos_lang_detect_plugin_lingonnx-0.1.0a1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-lang-detect-plugin-lingonnx 0.1.0a1
File Interpreter ABI Platform
ovos_lang_detect_plugin_lingonnx-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / ovos_lang_detect_plugin_lingonnx-0.1.0a1.tar.gz

Download URL ovos_lang_detect_plugin_lingonnx-0.1.0a1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e58de1be5e1a6bff417638b9b97e7894494af0d55633b5b8f91d257c8394bbd2
BLAKE2b-256 checksum
How to use checksums
f4c0ad9e8b5568af4f8c70cdb3edc098c7f7df9a3e0ebc6500e31e8ff535b6af
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_lingonnx-0.1.0a1-py3-none-any.whl

Download URL ovos_lang_detect_plugin_lingonnx-0.1.0a1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7325cf477386b17cc343ca3caeafd815bbf52ca53ee3e2645e84458096b1c0e3
BLAKE2b-256 checksum
How to use checksums
71eca6b5dda095ddaaef336f66ddbee27ff36f01f6c942106c68ec4bb16dcf37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page