Rasa NLU
En este ejercicio, usarás Rasa NLU para crear un interpreter, que analiza los mensajes de usuario entrantes y devuelve un conjunto de entidades. Tu tarea es entrenar un interpreter usando el modelo de reconocimiento de entidades MITIE en Rasa NLU.
Este ejercicio forma parte del curso
Creación de chatbots en Python
Instrucciones del ejercicio
- Crea un diccionario llamado
argscon una única clave"pipeline"y valor"spacy_sklearn". - Crea un
configllamando aRasaNLUConfig()con el único argumentocmdline_argscon el valorargs. - Crea un
trainerllamando aTrainer()usando la configuración como argumento. - Crea un
interpreterllamando atrainer.train()contraining_data.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Import necessary modules
from rasa_nlu.converters import load_data
from rasa_nlu.config import RasaNLUConfig
from rasa_nlu.model import Trainer
# Create args dictionary
args = ____
# Create a configuration and trainer
config = ____
trainer = ____
# Load the training data
training_data = load_data("./training_data.json")
# Create an interpreter by training the model
interpreter = ____
# Test the interpreter
print(interpreter.parse("I'm looking for a Mexican restaurant in the North of town"))