创建小型聊天机器人时出现rasa_nlu错误 [英] rasa_nlu error while creating small chatbot

查看:113
本文介绍了创建小型聊天机器人时出现rasa_nlu错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误ModuleNotFoundError:即使我安装了rasa_nlu和rasa,也没有名为"rasa_nlu"的模块

Iam getting the below error ModuleNotFoundError: No module named 'rasa_nlu', even though i installed rasa_nlu and rasa

我的代码:

from rasa_nlu.training_data import load_data
from rasa_nlu.config import RasaNLUConfig
from rasa_nlu.model import Trainer

def train_nlu(data, config, model_dir):
    training_data = load_data(data)
    trainer = Trainer(RasaNLUConfig(config))
    trainer.train(training_data)
    model_directory = trainer.persist(model_dir, fixed_model_name='weathernlu')
    
if __name__ == '__main__':
    train_nlu('.data/data.json', 'config_spacy.json', './models/nlu')

错误消息:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-6ab2834ad68f> in <module>()
----> 1 from rasa_nlu.training_data import load_data
      2 #from rasa_nlu.converters import load_data
      3 from rasa_nlu.config import RasaNLUConfig
      4 from rasa_nlu.model import Trainer
      5 

ModuleNotFoundError: No module named 'rasa_nlu'

有人请帮助我

推荐答案

在Rasa> = 1.0中,没有单独安装NLU.只是 rasa ,然后在代码中访问 rasa.nlu .确保您正在查看最新版本的文档,并已安装最新版本的rasa-

In Rasa >= 1.0, there is no separate installation of NLU. It's just rasa, and then in code you'd access rasa.nlu. Make sure you're looking at the latest version of the docs and have installed the latest version of rasa - https://rasa.com/docs/rasa/user-guide/installation/

这篇关于创建小型聊天机器人时出现rasa_nlu错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆