This release is a pre-release and may not be stable for production use.
Lang Classifier Classics
This package provides OVOS language-detection plugins for four classic algorithms:
- google/cld3: CLD3 is a neural network model for language identification.
- aboSamoor/pycld2: CLD2 is a Naive Bayesian classifier. It detects over 80 languages.
- kootenpv/fastlang: built on the NLTK stopword lists, without depending on NLTK itself.
- Mimino666/langdetect: detects the language of a text with a naive Bayesian filter.
The package also provides a VotingLangDetectPlugin. This plugin runs the other plugins and averages their predictions. Each model has a different bias, so the average is usually more accurate than any single model. See docs/algorithms.md for details on each algorithm and the voting logic.
To use the plugins above, run pip install ovos-lang-detector-plugin-voter[all]. If you only need the voter plugin, skip the [all] flag.
NOTE: The voter plugin works with any lang-detect plugin, not only the ones listed above.
Configuration
Add this to mycroft.conf:
"language": {
"detection_module": "ovos-lang-detector-plugin-voter",
"ovos-lang-detector-plugin-voter": {
"weights": {
"ovos-lang-detector-plugin-cld3": 0.8,
"ovos-lang-detector-plugin-cld2": 0.8,
"ovos-lang-detector-plugin-lingua-podre": 1.0,
"ovos-lang-detector-plugin-langdetect": 1.0,
"ovos-lang-detector-plugin-fastlang": 1.0,
}
}
},
Usage
weights = {
"ovos-lang-detector-plugin-cld3": 0.8,
"ovos-lang-detector-plugin-cld2": 0.8,
"ovos-lang-detector-plugin-lingua-podre": 1.0,
"ovos-lang-detector-plugin-langdetect": 1.0,
"ovos-lang-detector-plugin-fastlang": 1.0,
}
p = VotingLangDetectPlugin(config={"weights": weights})
for utt in ["hello world",
"olá mundo",
"hola mundo",
"once upon a time there was a voice assistant",
"era uma vez um assistente de voz"]:
print(p.detect(utt))
Related projects
- OpenVoiceOS/ovos-plugin-manager: defines the
LanguageDetectorbase class these plugins implement. - OpenVoiceOS/ovos-translate-server: a server that exposes language detection and translation plugins over HTTP.
Credits
The bundled plugins originally came from NeonGeckoCom but were never published on their own.
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovos_lang_detector_classics_plugin-0.0.2a1.tar.gz.
File metadata
- Download URL: ovos_lang_detector_classics_plugin-0.0.2a1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5693916fbbf657ce92b8ddde1e15f50d0cc2a97e40ffe5a30d2620d65191005
|
|
| MD5 |
7fcc92cbb3df445fbe25a7ce45448a10
|
|
| BLAKE2b-256 |
dccb2a06894a3c65a1220c605275a8a09440855d183edc4c47b2bd29baaf9b34
|
File details
Details for the file ovos_lang_detector_classics_plugin-0.0.2a1-py3-none-any.whl.
File metadata
- Download URL: ovos_lang_detector_classics_plugin-0.0.2a1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cfc4867ce32e05b66514b74a811ed2bc2c23a53220b5b40440fa3f596c2a95b
|
|
| MD5 |
74a84535471d98063ce291df0b14b053
|
|
| BLAKE2b-256 |
2e291edc3ff00f196209f7fb6a2da1b79d257b50823ae23ecf4fd2877a285dbb
|