Nlu_model problem

Hello I am starting with Rasa and for this code:

from future import absolute_import from future import division from future import print_function from future import unicode_literals

from rasa_nlu.training_data import load_data

from rasa_nlu.config import RasaNLUModelConfig

from rasa_nlu.model import Trainer, Metadata, Interpreter from rasa_nlu import config

def train (data, config_file, model_dir): training_data = load_data(data) configuration = config.load(config_file) trainer = Trainer(configuration) trainer.train(training_data) model_directory = trainer.persist(model_dir, fixed_model_name = ‘chat’)

def run(): interpreter = Interpreter.load(‘./models/nlu/default/chat’) print(interpreter.parse(‘I want to order pizza’)) #print(interpreter.parse(u’What is the reivew for the movie Die Hard?'))

if name == ‘main’: train(‘./data/training_data.json’, ‘./config/config.yml’, ‘./models/nlu’) run()

I get this type of error:

Traceback (most recent call last): File “”, line 7, in from rasa_nlu.training_data import load_data ImportError: cannot import name load_data

I kindly ask for help!

hi @kacperlsky - welcome to the forum! I suspect your code and installed version don’t match. The rasa_nlu module has been deprecated in favour of rasa.nlu . Are you on version >1.0 ?

Also, the Command Line Interface is generally a simpler way to interact with rasa

I’d like to use the API rather than the command line interface. Is there a .py example file similar to the above that we could follow to get things running in version > 1.0?

For example, if I’d like to report different evaluation measures when testing a model on a specific set, what can I do with the available command line options? As a python programmer, it just sounds really strange to me that a useful toolkit like rasa lacks enough documentation on the API calls. Was this a strategic decision to just make the API unavailable?