Last active
March 23, 2021 13:17
-
-
Save imohitmayank/0c363d0db3c5fe643ad367daad00d0cf to your computer and use it in GitHub Desktop.
rasa_starter/train_nlu.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
#----------- | |
# rasa nlu | |
from rasa_nlu.training_data import load_data | |
from rasa_nlu.config import RasaNLUModelConfig | |
from rasa_nlu.model import Trainer | |
from rasa_nlu import config | |
from rasa_nlu.model import Metadata, Interpreter | |
# Functions | |
#------------ | |
def train (data, config_file, model_dir): | |
training_data = load_data(data) | |
trainer = Trainer(config.load(config_file)) | |
trainer.train(training_data) | |
model_directory = trainer.persist(model_dir, fixed_model_name = 'chat') | |
# Training | |
#------------ | |
train('data/nlu_train.md', 'nlu_config.yml', 'models/nlu') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the train() function which is being called is not being closed. which will lead to an error.