Rasa NLU
In this exercise, you'll use Rasa NLU to create an interpreter
, which parses incoming user messages and returns a set of entities. Your job is to train an interpreter
using the MITIE entity recognition model in Rasa NLU.
Diese Übung ist Teil des Kurses
Building Chatbots in Python
Anleitung zur Übung
- Create a dictionary called
args
with a single key"pipeline"
with value"spacy_sklearn"
. - Create a
config
by callingRasaNLUConfig()
with the single argumentcmdline_args
with valueargs
. - Create a
trainer
by callingTrainer()
using the configuration as the argument. - Create a
interpreter
by callingtrainer.train()
with thetraining_data
.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# 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"))