Added lingua-franca

This commit is contained in:
Mathieu B 2021-07-29 23:03:01 +02:00
parent 568f6a3fce
commit 46c5b86f7c
2 changed files with 10 additions and 2 deletions

View File

@ -1,9 +1,11 @@
import flask import flask
import lingua_franca
from flask import Flask, request, jsonify, Response from flask import Flask, request, jsonify, Response
from jarvis.ia import process from jarvis.ia import process
from jarvis.skills import intent_manager from jarvis.skills import intent_manager
from jarvis.skills.entertainement.spotify import SpotifySkill from jarvis.skills.entertainement.spotify import SpotifySkill
from jarvis.utils import languages_utils
from utils import config_utils, flask_utils, intents_utils, utils from utils import config_utils, flask_utils, intents_utils, utils
app = Flask(__name__) app = Flask(__name__)
@ -34,6 +36,10 @@ def process_request():
if __name__ == '__main__': 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 # Tests
# WikipediaSkill().register() # WikipediaSkill().register()
# JokesSkill().register() # JokesSkill().register()
@ -43,7 +49,7 @@ if __name__ == '__main__':
# intent_manager.recognise("cherche sur wikipedia Elon Musk") # intent_manager.recognise("cherche sur wikipedia Elon Musk")
# intent_manager.recognise("raconte moi une blague") # 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 # start the flask server
app.config['JSON_AS_ASCII'] = False app.config['JSON_AS_ASCII'] = False

View File

@ -7,3 +7,5 @@ requests~=2.26.0
adapt-parser~=0.5.1 adapt-parser~=0.5.1
padatious~=0.4.8 padatious~=0.4.8
spacy~=3.1.1 spacy~=3.1.1
lingua-franca~=0.4.2
spotipy~=2.18.0