Skip to main content
Pre-release

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

OVOS Bidirectional Translation Plugin

This package holds two OVOS plugins: a UtteranceTransformer and a DialogTransformer. Together they let OVOS understand and answer in any language, even one the installed skills do not support directly.

This plugin is still in alpha.

Install

pip install ovos-bidirectional-translation-plugin

Language support in OVOS

This section is a refresher on how OVOS handles language.

  • A default language is set in mycroft.conf. This is the OVOS primary language. All skills, TTS plugins, and STT plugins must support it.
  • Extra languages can also be set in mycroft.conf. STT and TTS plugins in use must support these languages too. If an installed skill does not support one of them, OVOS ignores that skill for that language. Support can also be partial, per intent.
  • Skills register intents for each supported language. Together these intents define the languages OVOS can speak.
  • Each utterance carries an assigned language, through the session (message.context). OVOS picks this language from, in order of preference:
    • the default language, if nothing else is set
    • the wake word used
    • the language detected in speech (functional plugins for this exist, work is ongoing)
    • the language of a recognized user (not yet implemented)
    • the language set by the client application, for example a HiveMind satellite
{
  // Primary Language
  // Code is a BCP-47 identifier (https://tools.ietf.org/html/bcp47), lowercased
  "lang": "en-us",

  // Secondary languages will also have their resource files loaded into memory
  // but intents will only be considered if that lang is tagged with the utterance at STT step
  "secondary_langs": []
}

How it works

The ovos-utterance-translation-plugin plugin can detect the language of an utterance. When "verify_lang": true is set, it compares the detected language against the session language. This handles cases such as a chat platform where a user can write in any language and the session language may be wrong.

When "ignore_invalid_langs": true is set, the plugin ignores a detected language that is not one of the configured native languages, to guard against false detections. Otherwise, it fixes the session language to the detected one.

Language tags are compared by tag distance, the same rule the rest of OVOS applies. A regional variant counts as one of the native languages, so ar-SA is native when the system supports ar, and pt-BR is native when the system supports pt-PT. A macrolanguage member such as arz is a different language and is translated.

If the session language is not one of the native languages, the plugin translates the utterance to the primary language, so OVOS can understand it.

The native languages are the primary language plus the secondary languages. Set "translate_secondary_langs": true to keep only the primary language native, so the plugin also translates the secondary languages before OVOS handles them.

When "bidirectional": true is set, the ovos-dialog-translation-plugin plugin then translates OVOS dialogs back to the original session language. Otherwise OVOS answers in its primary language, even if the user spoke in a different one.

Prerequisites

This plugin needs a language detection plugin and a language translation plugin configured beforehand.

In ovos-docker, install this plugin in both ovos-core and ovos-audio, together with the translation plugins.

Recommended plugins:

{
  "language": {
    "detection_module": "ovos-lang-detect-ngram-lm",
    "translation_module": "ovos-translate-plugin-nllb",
    "ovos-translate-plugin-nllb": {
      "model": "nllb-200_600M_int8"
    }
  }
}

Configuration

{
  "utterance_transformers": {
    "ovos-utterance-translation-plugin": {
      "bidirectional": true,
      "verify_lang": false,
      "ignore_invalid_langs": true,
      "translate_secondary_langs": false
    }
  },
  "dialog_transformers": {
    "ovos-dialog-translation-plugin": {}
  }
}

License

Apache-2.0. See LICENSE.

Metadata

Release files for ovos-bidirectional-translation-plugin 0.1.5a1

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-bidirectional-translation-plugin 0.1.5a1
File Size Uploaded Provenance Actions
ovos_bidirectional_translation_plugin-0.1.5a1.tar.gz 11.5 kB Without provenance Details for ovos_bidirectional_translation_plugin-0.1.5a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ovos-bidirectional-translation-plugin 0.1.5a1
File Interpreter ABI Platform Actions
ovos_bidirectional_translation_plugin-0.1.5a1-py3-none-any.whl Python 3 none any Details for ovos_bidirectional_translation_plugin-0.1.5a1-py3-none-any.whl

Total release size: 22.4 kB

Release files / ovos_bidirectional_translation_plugin-0.1.5a1.tar.gz

Download URL ovos_bidirectional_translation_plugin-0.1.5a1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ebdf872770d0f42a23143e69fe824d4aa3badaadbd5b619ddd26f8073390212c
BLAKE2b-256 checksum
How to use checksums
954337763800aa9a0b2b9433e2748087c4e70950a05906cf6554ac5784de06f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ovos_bidirectional_translation_plugin-0.1.5a1-py3-none-any.whl

Download URL ovos_bidirectional_translation_plugin-0.1.5a1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
551f4fcc7cd13e362897c659bc9018108fa85d896be0bef0b1854d5b7b764556
BLAKE2b-256 checksum
How to use checksums
3f62102fb81224226dd3cfb26fa6d92ca493407a85f10ded34c35e859c93a588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ovos-bidirectional-translation-plugin 0.1.5a1

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.

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