Table of contents generated with markdown-toc
End-to-end framework to build automatic agents (chatbots) for task-oriented dialogs
- 💬 Use chat interfaces to collect dialog data and interact with agents
- 🤖 Build/deploy automated chatbot agents with your own ML/rule-based models
- 📈 Evaluate chatbots using 1) agent-action annotations 2) user-satisfaction scores
Quickly deploy for any domain by leveraging domain-agnostic modules
- Data collection interface self-annotates dialogs for training/evaluation data
- Train a chatbot without ML knowledge using generic ML models, or write a custom model
- Evaluate any chatbot's accuracy as a black-box, or inspect its internal actions as a white-box
Chat interfaces are deployed with a simple web architecture more details in a Google drive. The backend is Python/Flask/sockets and the frontend is Preact/Redux.
Below is a short snippet of a user interacting with a chatbot that helps them specify a destination for a taxi ride.
Live Chatbot: http://35.212.174.248:9999/0/user. Chat directly with the chatbot here.
- Tested on python 3.6.3, requires python 3.6+ for the newer versions of the transformers module.
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
- This installs server and API dependencies. Some agents require additional installation. See their folders for details or install
requirements-full.txt
.
- Requires Node.js. Tested with Node 12.10
If node is not installed, follow these instructions for Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs
Install the required dependencies.
cd gui/frontend
npm install
Backend configuration is all done through command line arguments to main.py.
Run python main.py --help
for a list of options.
If you are running a domain that requires API keys, you need to create the gui/backend/keys/api_keys.json
file and set them there.
Here's an example of api_keys.json:
{
"darksky": "my_api_key1",
"google_maps": "my_api_key2",
"google_speech": "my_api_key_file.json",
"wit_date": "my_api_key3"
}
Frontend configuration is done using dotenv,
stored in the auto-generated configuration file gui/frontend/.env
.
There is an example at gui/frontend/.env.example
You can modify the parameters in this configuration file after it is generated by the front-end
start-up command.
For domains that require frontend API keys (e.g. destination), you should add the keys there.
Let's start a chat interface for the simple compare_numbers domain that determines whether one number is greater than another.
BACKEND_PORT=8081
FRONTEND_PORT=8082
LOG_DIR=logs/tutorial
cd gui/backend
python main.py --port=$BACKEND_PORT --domain=compare_numbers --num_rooms=1 --log_dir=$LOG_DIR
This starts a backend for human-agents that make api calls and reply to user utterances via the agent UI.
To see what it's like to interact with a chatbot-agent, add --agent_class_name=agents.compare_numbers_agent.CompareNumbersAgent
to the command above.
cd gui/frontend
./run.sh $BACKEND_PORT $FRONTEND_PORT
The front-end command will output URLs to access the chat interface, e.g. http://0.0.0.0:8082
.