This release is a pre-release and may not be stable for production use.
ovos-utterance-normalizer
ovos-utterance-normalizer is an utterance transformer plugin for OpenVoiceOS. It runs after speech-to-text and before the intent engines. It gives the intent pipeline extra candidate utterances, and one of these candidates writes numbers as digits.
from ovos_utterance_normalizer import UtteranceNormalizerPlugin
plugin = UtteranceNormalizerPlugin()
plugin.transform(["i'm sure it's twenty past five"], {"lang": "en-US"})[0]
# ["i'm sure it is twenty past five", "i'm sure it's twenty past five", "i'm sure it is 20 past 5"]
What the plugin does
For each utterance, transform returns up to three candidates in this order:
- the utterance with its contractions expanded;
- the utterance as received;
- the normalized utterance, with number words written as digits and the settings of the language applied.
The plugin removes punctuation from the start and the end of each candidate, and it removes duplicates. Before these steps, it repairs text encoding errors with ftfy. See docs/candidates.md.
Numbers
The plugin reads numbers with numtag, only in the languages of NUMBER_LANGUAGES: an, ar, bg, ca, cs, de, en, es, et, fi, gl, he, hr, id, nb, pt, ro, ru, sk, sl, tr and uk. Every other language passes through unchanged. A language enters the set when a value check over the shipped skill locales finds no new wrong digit for it.
Only a whole-number cardinal said in words becomes digits, when numtag marks it as no article and no word with another meaning. Ordinals, fractions and decimals keep their words. Articles keep their words too. numtag still reads the English pronoun "one" as a number, as in "read the next one". See the known misreads in docs/numbers.md. numtag does not find idioms or titles, so a number word in an idiom also becomes digits: "mil gracias" gives "1000 gracias".
| Language | Input | Normalized candidate |
|---|---|---|
| pt-PT | põe um temporizador de vinte e cinco minutos | põe um temporizador 25 minutos |
| en-US | the twenty first of may | the twenty first of may |
| de-DE | stell einen Timer auf fünfundzwanzig Minuten | stell einen Timer auf 25 Minuten |
| es-ES | tengo treinta y dos años | tengo 32 años |
See docs/numbers.md and docs/languages.md.
Digits can help a template or keyword engine with a number slot. They do not help every pipeline: an engine trained on raw speech-to-text output, or an engine based on a large language model, can gain nothing or do worse. No gain is measured. See docs/intent-matching.md.
No OpenVoiceOS specification defines this normalization. OVOS-INTENT-1 §2 names a separate text-normalization specification that does not exist. See docs/specification.md.
Install
The package needs Python 3.11 or newer.
uv pip install --prerelease=allow ovos-utterance-normalizer
Configuration
The default mycroft.conf of ovos-config turns the plugin on:
"utterance_transformers": {
"ovos-utterance-normalizer": {}
}
| Key | Default | What it does |
|---|---|---|
lang |
"en-us" |
The language to use when the message context has no lang |
fix_encoding_errors |
true |
Repairs encoding errors with ftfy |
strip_punctuation |
true |
Removes punctuation from the start and the end of each candidate |
active |
true |
When it is false, the plugin does not load |
Documentation
The docs directory holds one page for each topic: candidates, the normalized candidate, numbers, languages, contractions, configuration, intent matching and the specification status.
Related projects
- ovos-plugin-manager loads and runs this plugin as an
opm.transformer.texttransformer. - ovos-config holds the default
mycroft.confthat turns this plugin on. - ovos-core calls the utterance transformers before intent matching.
- numtag finds the numbers and their values.
License
Apache-2.0
Metadata
Release files for ovos-utterance-normalizer 0.2.7a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ovos_utterance_normalizer-0.2.7a1.tar.gz | 17.1 kB | Without provenance | Details for ovos_utterance_normalizer-0.2.7a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ovos_utterance_normalizer-0.2.7a1-py3-none-any.whl | Python 3 | none | any | Details for ovos_utterance_normalizer-0.2.7a1-py3-none-any.whl |
Total release size: 37.1 kB
Release files / ovos_utterance_normalizer-0.2.7a1.tar.gz
| Download URL | ovos_utterance_normalizer-0.2.7a1.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6231197d10e1e3b5af7171a7d0244998fabb8d824fa2f4b2353b9fb9615555ec
|
|
BLAKE2b-256 checksum How to use checksums |
9e7c17e7c4ef229894a946f2a47f3a41491948a212059394ad38ffe562f9fcdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ovos_utterance_normalizer-0.2.7a1-py3-none-any.whl
| Download URL | ovos_utterance_normalizer-0.2.7a1-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34bb3e5a99afcd983ba28a2255e4727f700806c60d250d234e2f2abf091d8f60
|
|
BLAKE2b-256 checksum How to use checksums |
edcfa4f05213049ef79756f82d01c1a1f3af2eb9ec84341a4c2d2c53fe1855a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ovos-utterance-normalizer 0.2.7a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.