MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.51k stars 1.27k forks source link

Intent service support for multiple languages #2994

Closed Joanguitar closed 2 years ago

Joanguitar commented 3 years ago

Description

New (optional) parameter in Mycroft config file: "supported_langs" consisting on an array of languages, for example {"supported_langs": ["en-us", "es-es"]}

Based in this parameter Mycroft will: -Create multiple language dialog renders -Create multiple adapt and padatious containers that will be used to match the intent based on the message's language -Each adapt and padatious container is trained using only the language is set to. -Skills self.lang property is temporarily modified to match the intent language. -Language is included in skill's speak bus messages for future multi-language TTS support.

This PR is meant for future development and for current usage with HiveMind-core as there are some clients such as this fork of the voice satellite that already support multiple language support.

After this PR gets approved I will work on multi-language TTS support.

How to test

Easiest way to test is to configure multiple languages including the supported_langs parameter in Mycroft's config file and then inject a message in the messagebus in any of the supported languages. For example:

from mycroft_bus_client import MessageBusClient, Message

print('Setting up client to connect to a local mycroft instance')
client = MessageBusClient()
client.run_in_thread()

print('Sending speak message...')
client.emit(Message(
    'recognizer_loop:utterance',
    data={'utterances': ['que hora es'], 'lang': 'es-es'},
    context={
        'client_name': 'mycroft_cli',
        'source': 'debug_cli',
        'destination': ['skills']}
    ))

The code above will inject a message in Spanish pretending to be the debug cli, therefore printing the answer in the debug_cli if this one is open.

Contributor license agreement signed?

CLA [x] Yes, I have already signed the CLA.

pep8speaks commented 3 years ago

Hello @Joanguitar! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2021-09-06 22:20:34 UTC
Joanguitar commented 3 years ago

Hello @Joanguitar! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-09-06 16:05:31 UTC

Great, I will squash my PEP 8 commits and force push.

devops-mycroft commented 3 years ago

Voight Kampff Integration Test Succeeded (Results)

Joanguitar commented 2 years ago

Already implemented in HolmesV, and Mycroft has no intention of multi-language support in the short term, so I'm closing this PR.