How to deploy rasa chatbot

2020-06-26 05:48发布

问题:

I have build a chatbot using rasa framework. Now I want deploy it over my website but I dont want deploy it using chatterbot or Docker. I am googling but I am not getting it.

How to deploy the chatbot on my website?

回答1:

  1. Install Rasa Core and Rasa using pip / anaconda as it is described here (Rasa Core) and here (Rasa NLU).
  2. Train your Core and NLU model
  3. Start NLU as server using python -m rasa_nlu.server --path projects (see here for the docs). Do this using a tool like nohup so that the server is not killed when you close your terminal window
  4. Edit the endpoint configuration file for Rasa Core so that it links to NLU (see docs here):

    nlu: url: "http://<your nlu host>:5000"

  5. Decide how you want to connect the bot on your website to Rasa. It's probably either via REST or using socketio. Add configuration for the used channel to a credentials file, e.g. for REST

    rest: # you don't need to provide anything here - this channel doesn't # require any credentials

  6. Run Rasa Core

    python -m rasa_core.run -d <path to core model> \ -u <nlu model you want to use> \ --endpoints <path to your endpoint configuration (includes NLU url) \ --credentials <channel credentials>

  7. Call the Rest or the socket io endpoint from your website. Here is a small chat widget which you can embed in your website and uses socketio to communicate with Rasa.