ComenzarEmpieza gratis

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

Ver curso

Instrucciones del ejercicio

  • Crea un diccionario llamado args con una única clave "pipeline" y valor "spacy_sklearn".
  • Crea un config llamando a RasaNLUConfig() con el único argumento cmdline_args con el valor args.
  • Crea un trainer llamando a Trainer() usando la configuración como argumento.
  • Crea un interpreter llamando a trainer.train() con training_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"))
Editar y ejecutar código