小编adr*_*rey的帖子

如何使用 Spacy 将 Rasa Bot 部署到 Heroku

我使用 Rasa NLU 和 Rasa Core 制作了一个机器人。它连接到 Node.js 服务器和 React.js 前端。我运行这个 python 脚本的方式是:

var PythonShell = require('python-shell');

var options = {
    mode: 'text',
    pythonOptions: ['-u'],
    scriptPath: './server/Rasa_Bot_Final'
};

var pyshell = new PythonShell('dialogue_management_model.py', options);


app.post('/message', (req, res) => {
    pyshell.on('message', function (message) {
        // received a message sent from the Python script (a simple "print" statement)
        res.end(message)
    });
    pyshell.send(req.body.messageFromUser);
})
Run Code Online (Sandbox Code Playgroud)

这在我的本地主机上有效,但是,当部署到 heroku 时,我收到此错误:

Error: OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python …
Run Code Online (Sandbox Code Playgroud)

python heroku rasa-nlu

3
推荐指数
1
解决办法
2195
查看次数

标签 统计

heroku ×1

python ×1

rasa-nlu ×1