Git Product home page Git Product logo

rasa-change-plan's Introduction

Building a chatbot for the change plan use case with Rasa

In this repo, I will show how to build a simple chatbot for the change plan use case using Rasa NLU and Rasa Core libraries. In particular, I will show how to build such a system based on a workflow that we designed before. The ChangePlan flow is shown below:

alt text

Walk through the design and annotation

The ontology design and data collection are largely based on the flow.

Ontology design

The ontology is defined in the changeplan_domain file. There are five user intents and six bot actions. Two slots are involved: planType and isGrandfathered. We also define some prompts.

Data annotation

The training data for NLU and policy learning are available at data/nlu/data.json and data/stories.md respectively. The NLU annotations are manually generated while the policy annotations are created by rolling out the workflow.

How to use this repo

You can use the repo to build a chatbot within a few minutes! Two example conversations are shown below. They differ in the is_grandfathered slot value.

Conversation 1 (is_grandfathered=True): alt text

Conversation 2 (is_grandfathered=False): alt text

Install Rasa NLU and Rasa Core

Install Rasa libraries with:

pip install rasa=0.15.0a6

If this does not work, then:

pip install rasa-core==0.13.2
pip install rasa-nlu==0.14.6

Training the NLU model

To train and test the NLU model run:

python nlu_model.py

(you may train multiple times until "yes" leads to the confirm intent...)

Training the Rasa Core model

To run the dialogue manager, we need to start a server that is configured in a 'endpoints.yml' file. This is how to train and run the dialogue management model:

  1. Start the custom action server by running:

python -m rasa_core_sdk.endpoint --actions actions

  1. Open a new terminal and train the Rasa Core model by running:

python dialogue_management_model.py

  1. Talk to the chatbot once it's loaded.

Starting the interactive training session:

We can use the Rasa interactive training feature to collect more training data for both NLU and policy learning. The process of running the interactive session is very similar to training the Rasa Core model:

  1. Make sure the custom actions server is running:

python -m rasa_core_sdk.endpoint --actions actions

  1. Start the interactive training session by running:

python train_interactive.py

rasa-change-plan's People

Contributors

yi-asapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.