I made a bot using Rasa NLU and Rasa Core. It is connected to a Node.js server and React.js Front end. The way I run this python script is:
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);
})
This works on my localhost, however, when deploying to heroku, I get this error:
Error: OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
This is because I am unable to run:
python -m spacy download en_core_web_md
python -m spacy link en_core_web_md en
on heroku.
Can someone please help me get around this?
I've referenced these: https://spacy.io/usage/