1

Al tener problemas con el tutorial, seguí el chatbot rasa de clima proporcionado porJustina Petraityte, puedes encontrar el repositorio de GitHub aquí. Sin embargo, mi chatbot nunca reconoce la intención que traté de darle cuando cuando intento con run_online.py, que tiene que ser la ubicación, y no sé cómo manejar este caso en la medida en que crea un error al llamar a la API meteorológica, que por lo tanto está vacía. Aqui esta run_online.py :

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from rasa_core.agent import Agent
from rasa_core.channels.console import ConsoleInputChannel
from rasa_core.interpreter import RegexInterpreter
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
from rasa_core.interpreter import RasaNLUInterpreter

logger = logging.getLogger(__name__)


def run_weather_online(input_channel, interpreter,
                          domain_file="weather_domain.yml",
                          training_data_file='data/stories.md'):
    agent = Agent(domain_file,
                  policies=[MemoizationPolicy(), KerasPolicy()],
                  interpreter=interpreter)

    agent.train_online(training_data_file,
                       input_channel=input_channel,
                       max_history=2,
                       batch_size=50,
                       epochs=200,
                       max_training_samples=300)

    return agent


if __name__ == '__main__':
    logging.basicConfig(level="INFO")
    nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu/test')
    run_weather_online(ConsoleInputChannel(), nlu_interpreter)

Por ejemplo, traté de preguntar por el clima en Italia pero, como pueden ver aquí. No reconoce a Italia como una intención, incluso si estaba en data.json.

Por lo tanto, ¿qué hacer cuando el intento no es reconocido? ¿Deberíamos aún guardarlo en stories.md?

Contenido del archivo de domain :

action_factory: null
action_names:
- utter_greet
- utter_goodbye
- utter_ask_location
- action_weather
actions:
- utter_greet
- utter_goodbye
- utter_ask_location
- actions.ActionWeather
config:
  store_entities_as_slots: true
entities:
- location
intents:
- greet
- goodbye
- inform
slots:
  location:
    initial_value: null
    type: rasa_core.slots.TextSlot
templates:
  utter_ask_location:
  - text: In what location?
  utter_goodbye:
  - text: Talk to you later.
  - text: Bye bye :(
  utter_greet:
  - text: Hello! How can I help?
topics: []

Rasa Core version:

(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ pip list :
...
rasa-core (0.9.0a3)
rasa-nlu (0.12.3)

Python version:

(MoodbotEnv) mike@mike-thinks:~/Programing/Rasa_tutorial/moodbot4$ python -V 
Python 3.5.2

Operating system : Linux 16.04

1 respuesta 1

0

Bastante extraño, pero después de volver a instalar el servidor, spacy, parece que resolvió el problema:

pip install rasa_nlu [spacy]
python -m spacy download en_core_web_md
python -m spacy link en_core_web_md en

Supongamos que me olvido de descargarlo: /

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.