diff --git a/jarvis/ia/trained_model.pth b/jarvis/ia/trained_model.pth index fa492ed..faf8208 100644 Binary files a/jarvis/ia/trained_model.pth and b/jarvis/ia/trained_model.pth differ diff --git a/jarvis/main.py b/jarvis/main.py index d0c0595..777f56b 100644 --- a/jarvis/main.py +++ b/jarvis/main.py @@ -1,6 +1,7 @@ import flask from flask import Flask, request, jsonify, Response +import jarvis.ia.process from utils import config_utils, flask_utils, intents_utils, utils app = Flask(__name__) @@ -14,7 +15,7 @@ def process_request(): flask.abort(Response('You must provide a \'sentence\' parameter (not empty aswell)!')) sentence = data['sentence'] - tag_for_request = src.ia.process.get_tag_for_sentence(sentence) + tag_for_request = jarvis.ia.process.get_tag_for_sentence(sentence) print("SENTENCE : " + sentence + " /// TAG : " + tag_for_request) diff --git a/jarvis/utils/nlp_utils.py b/jarvis/utils/nlp_utils.py index b4994be..22986b3 100644 --- a/jarvis/utils/nlp_utils.py +++ b/jarvis/utils/nlp_utils.py @@ -2,9 +2,14 @@ import spacy from jarvis.utils import languages_utils +nlp = None + def get_spacy_nlp(): - nlp = spacy.load(languages_utils.get_spacy_model()) + global nlp + + if nlp is None: + nlp = spacy.load(languages_utils.get_spacy_model()) return nlp