Hello,
I have a data for a project I am working on. I want to train model (tensorflow_embedding pipeline) on the data.
So I inside the rasa_nlu.py file, i wrote the following code
from rasa_nlu.training_data import load_data
from rasa_nlu.model import Trainer
from rasa_nlu import config
from rasa_nlu.model import Interpreter
def train_bacentabot(data_json, config_file, model_dir):
training_data = load_data(data_json)
trainer = Trainer(config.load(config_file))
trainer.train(training_data)
model_directory = trainer.persist(model_dir, fixed_model_name = 'bacentabot')
def predict_intent(text):
interpreter = Interpreter.load('./models/nlu/default/bacentabot')
print(interpreter.parse(text))
Afterwards, I started the python interpreter as shown below and typed the following method to train the model on the data but it showed this error:
>>> train_bacentabot('./data/data.json', 'config.json', './models/nlu')
Error message:
File "<stdin>", line 1, in <module>
NameError: name 'train_bacentabot' is not defined
Any help please?