Code Monkey home page Code Monkey logo

rasa-demo's Introduction

Sara - the Rasa Demo Bot

🏄 Introduction

The purpose of this repo is to showcase a contextual AI assistant built with the open source Rasa framework.

Sara is an alpha version and lives in our docs, helping developers getting started with our open source tools. It supports the following user goals:

  • Understanding the Rasa framework
  • Getting started with Rasa
  • Answering some FAQs around Rasa
  • Directing technical questions to specific documentation
  • Subscribing to the Rasa newsletter
  • Requesting a call with Rasa's sales team
  • Handling basic chitchat

You can find planned enhancements for Sara in the Project Board

👷‍ Installation

To install Sara, please clone the repo and run:

cd rasa-demo
make install

This will install the bot and all of its requirements. Note that this bot should be used with python 3.6 or 3.7.

🤖 To run Sara:

Use rasa train to train a model (this will take a significant amount of memory to train, if you want to train it faster, try the training command with --augmentation 0).

Then, to run, first set up your action server in one terminal window:

rasa run actions --actions actions.actions

There are some custom actions that require connections to external services, specifically SubscribeNewsletterForm and SalesForm. For these to run you would need to have your own MailChimp newsletter and a Google sheet to connect to. See the development section for instructions on providing credentials for external services.

In another window, run the bot:

docker run -p 8000:8000 rasa/duckling
rasa shell --debug

Note that --debug mode will produce a lot of output meant to help you understand how the bot is working under the hood. To simply talk to the bot, you can remove this flag.

If you would like to run Sara on your website, follow the instructions here to place the chat widget on your website.

To test Sara:

After doing a rasa train, run the command:

rasa test nlu -u test/test_data.json --model models
rasa test core --stories test/test_stories.md

👩‍💻 Overview of the files

data/core/ - contains stories

data/nlu - contains NLU training data

actions - contains custom action code

domain.yml - the domain file, including bot response templates

config.yml - training configurations for the NLU pipeline and policy ensemble

Development

To install requirements for development, run:

make install-dev

To run custom actions locally, put a file called .env in the root of your local directory with values for the following environment variables. Most actions will work without them, but if you are working on actions connecting to external APIs you will need credentials.

GDRIVE_CREDENTIALS=#json access key for Google Drive API for action_submit_sales_form
MAILCHIMP_LIST=#id of mailchimp list for action_submit_subscribe_newsletter_form
MAILCHIMP_API_KEY=#api key for mailchimp
ALGOLIA_APP_ID=#algolia app ID for action_docs_search 
ALGOLIA_SEARCH_KEY=#algolia search key
ALGOLIA_DOCS_INDEX=#algolia search index
RASA_X_HOST=#Rasa X domain e.g. localhost:5002
RASA_X_PASSWORD=#password for authenticating into Rasa X
RASA_X_USERNAME=#username for authenticating into Rasa X
RASA_X_HOST_SCHEMA=#Rasa X address schema (http/https)

To run unit tests for custom actions:

make test-actions

To ensure proper database cleanup during testing, you will need to include a connection URL for your tracker store database in your .env file e.g.

TRACKER_DB_URL=postgresql:///tracker

This is not necessary for running the actions.

⚫️ Code Style

To ensure a standardized code style we use the formatter black.

If you want to automatically format your code on every commit, you can use pre-commit. Just install it via pip install pre-commit and execute pre-commit install in the root folder. This will add a hook to the repository, which reformats files on every commit.

To reformat files manuallly execute

make formatter

🎁 License

Licensed under the GNU General Public License v3. Copyright 2018 Rasa Technologies GmbH. Copy of the license. Licensees may convey the work under this license. There is no warranty for the work.

rasa-demo's People

Contributors

akelad avatar alexweidauer avatar amn41 avatar arjaanbuijk avatar b-quachtran avatar btotharye avatar claverru avatar epedrotti avatar erohmensing avatar github-actions[bot] avatar hellonu avatar hotthoughts avatar hsm207 avatar indam23 avatar keithjstone avatar kr-prince avatar ksurya avatar ls1707 avatar mrjazz avatar msamogh avatar rgstephens avatar samsucik avatar tabergma avatar tristanappdev avatar tydunn avatar wochinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rasa-demo's Issues

Doesn't recognize many options for use cases

"Tell me more about your use case: what kind of bot do you want to build with Rasa?"

Tried a few things:
'health care' -> wasn't able to deal with request
'customer service' -> thought I wanted to talk to a real person
'slack bot' -> worked.

Might be good to have it recognize more use cases

Setup project

  • export from botsociety
  • go over the export and see if everything was exported correctly

bot vision

"I just want to be able to see if you can help me with a bot at my company with around 1000 calls per day, I’d like to know xyz
I want to be helped - pushed in the right direction with options, and maybe accepting of general responses somewhere in that mix"

doesn't scroll down when it messages me

i say hi, it says hi there and sends me two more messages, but doesn't scroll down the chat window so I can't see the two messages, I have to manually scroll down, which is weird and confusing

Feedback

Tristan:
elise [5:01 PM]
overall feedback: it’s a bit painful
it’s not really better than a contact form because it’s so like “call & response over and over”
it failed to understand my company
I don’t see how it’s better than a contact form because it’s too dragged out

linda [5:06 PM]
ok, thank you - contacting sales is maybe not the best use case to show what conversational AI can do, that's correct, but that was the only thing we could agree on haha :face_with_rolling_eyes:

elise [5:07 PM]
haha yeah fair enough
his final words:
I just want to be able to see if you can help me with a bot at my company with around 1000 calls per day, I’d like to know xyz
I want to be helped - pushed in the right direction with options, and maybe accepting of general responses somewhere in that mix

repeat the email that we have extracted

"Looks like you're already subscribed - congrats, that was a good choice! If you haven't received a newsletter in a while, maybe check your spam folder."

"Looks like your email [email protected] is already subscribed - congrats, that was a good choice! If you haven't received a newsletter in a while, maybe check your spam folder."

out of scope flow wording

screen shot 2018-06-14 at 3 37 55 pm

The "awesome, thanks!" part of the message doesn't make much sense here. what if we sent just the "awesome, thanks" separately when they've accepted the policy?

Go over NLU data

  • see if entity/intent structure created by Linda will work with NLU
  • adjust domain/stories accordingly, and write some more

integrate bot into docs

The bot should live on a subpage of both docs, we haven't decided exactly where in the menu (I'll post that in the comments once we've decided that).

The page should contain

@eliseboyd we will probably make a few iterations of the intro message anyways, but if you have an idea to make it a little bit cooler, feel free to change it

Store collected data somewhere

  • For the newsletter: send the email address to the mailchimp API or similar
  • For the sales stuff: store in a spreadsheet

Make the URLs actual links

no idea how, but the widget does not do this automatically. @eliseboyd idk if you have any ideas but i'm assigning it to you since i feel like you're more capable at finding this out than me.

solve hacky fallback for slot filling solution

akela: i just had a thought, i’m a bit concerned in terms of open sourcing the bots code - currently in custom actions we take the full text of user message as a fallback for the slot, because for things like job roles for example people can say anything. That’s a bit of a hacky solution, so I’m not sure how “good” that’s going to look. But on the other hand getting rid of that will probably mean the bot performs poorer. @alan @tmbo what do you think?

change/ add out of scope messages

I'd say have two out of scope messages, one for the intent recognised as out_of_scope saying something like: "Sorry, I can’t deal with that request. You can either book a sales call or subscribe to our newsletter"
And one for NLU confidence being low, e.g. "Sorry I didn't understand that, could you rephrase?

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.