From 46c5b86f7cafec320f2961c743ed858228907c47 Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Thu, 29 Jul 2021 23:03:01 +0200 Subject: [PATCH] Added lingua-franca --- jarvis/main.py | 8 +++++++- requirements.txt | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/jarvis/main.py b/jarvis/main.py index c5fab4e..57c7e2a 100644 --- a/jarvis/main.py +++ b/jarvis/main.py @@ -1,9 +1,11 @@ import flask +import lingua_franca from flask import Flask, request, jsonify, Response from jarvis.ia import process from jarvis.skills import intent_manager from jarvis.skills.entertainement.spotify import SpotifySkill +from jarvis.utils import languages_utils from utils import config_utils, flask_utils, intents_utils, utils app = Flask(__name__) @@ -34,6 +36,10 @@ def process_request(): if __name__ == '__main__': + # Load lingua franca in the memory + # Supported : English French German Hungarian Italian Portuguese Swedish + lingua_franca.load_language(lang=languages_utils.get_language().split("-")[0]) + # Tests # WikipediaSkill().register() # JokesSkill().register() @@ -43,7 +49,7 @@ if __name__ == '__main__': # intent_manager.recognise("cherche sur wikipedia Elon Musk") # intent_manager.recognise("raconte moi une blague") - intent_manager.recognise("joue le morceau crazy crazy nights de KISS sur spotify") + # intent_manager.recognise("joue le morceau crazy crazy nights de KISS sur spotify") # start the flask server app.config['JSON_AS_ASCII'] = False diff --git a/requirements.txt b/requirements.txt index c07d934..7f2b258 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,6 @@ numpy~=1.21.1 requests~=2.26.0 adapt-parser~=0.5.1 padatious~=0.4.8 -spacy~=3.1.1 \ No newline at end of file +spacy~=3.1.1 +lingua-franca~=0.4.2 +spotipy~=2.18.0 \ No newline at end of file