RasaHQ / livestream-tf-pipeline

Code of the Rasa Twitch livestream on building bots with multi-intents using Rasa NLU TensorFlow pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Twitch Stream] Building a Meetup chatbot using Rasa Stack

In release 0.12, Rasa introduced a new TensorFlow-based pipeline for NLU models. This repository contains the code which was used during our Twitch live coding stream on 28/06/2018. During the stream we built a Meetup chatbot, capable of recommending meetups to attend, make RSVPs for the events and recommend public transport routes to get to the venue. The goal of building this chatbot is to demonstrate how we can use Rasa NLU TensorFlow pipeline to build intelligent chatbots which can understand multiple intents per input. The recording of the stream can be found here.

User: Hello.
Bot: Hey, how can I help you?
User: I am new to London and I am looking for fitness meetups to attend. Any suggestions?
Bot: Sure. There is a 'Tennis in Central London' meetup happening in London. They are having an event 'Social Tennis' on 2018-07-05. Would you like to join the meetup?
User: Yes, please.
Bot: Done! You have joined the meetup. Would you like to attend their nearest event?
User: Yes. Can you also tell me how can I get to the venue from Baker Street?
Bot: All done. I have booked you a spot at 'Social Tennis' which is happening on 2018-07-05. Here are the directions for getting to the venue using a public transport: Walk to Baker Street Underground. Catch a Bakerloo line to Piccadilly Circus. Change to Piccadilly line to Knightsbridge. Walk to Hyde Park.
User: Thanks a lot! Goodbye.
Bot: You are very welcome!
Bot: Bye bye.

The chatbot includes live data APIs. In order to access the data yourself, you will need to get the API keys and store them as environmental variables. Below are instructions on how to do it:

  1. Meetup API:

    1. Get the API key here
    2. Copy the key, open your command line and execute:
      • Ubuntu and Mac OS:
         export MEETUP_KEY=*your_api_key*
        
      • Windows:
         set MEETUP_KEY=*your_api_key* 
        
  2. Google Directions API:

    1. Get the API key by following the instructions written in a section Activate the API and get an API key
    2. Copy the key and in your command line execute:
      • Ubuntu and Mac OS:
         export GOOGLE_KEY=*your_api_key* 
        
      • Windows:
         set GOOGLE_KEY=*your_api_key*
        

Versions of the software used in this tutorial:

  • Python 3.6
  • Rasa NLU 0.12.3
  • Rasa Core 0.9.6

How to use this repository:

  1. Clone or download the repository and install Rasa NLU and Rasa Core:
pip install -r requirements.txt
  1. Install a spacy language model:
python -m spacy download en
  1. Watch the stream and implement a bot from scratch by using the code inside the directory called 'Stream_Code'.

  2. You can load and chat with the bot at any time by executing the following command inside the main directory of this repository (don't forget to set the API keys):

python -m rasa_core.run -d models/current/dialogue -u models/current/nlu_model

Useful resources:

About

Code of the Rasa Twitch livestream on building bots with multi-intents using Rasa NLU TensorFlow pipeline


Languages

Language:Python 100.0%