Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 86357c8

Browse files
author
Guangsen Wang
committed
init commit
0 parents  commit 86357c8

File tree

153 files changed

+31792
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+31792
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
release:
9+
types: [ published ]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.8'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip setuptools wheel
27+
sudo apt-get update
28+
sudo apt-get install openjdk-11-jdk
29+
sudo apt-get install pandoc
30+
- name: Build Sphinx docs
31+
run: |
32+
docs/build_docs.sh
33+
- name: Deploy to gh-pages
34+
uses: peaceiris/actions-gh-pages@v3
35+
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: docs/_build/html

Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM nvcr.io/nvidia/pytorch:20.12-py3
2+
3+
4+
ARG device
5+
6+
COPY requirements_${device}.txt requirements_${device}.txt
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
locales \
12+
wget \
13+
build-essential \
14+
vim \
15+
htop \
16+
curl \
17+
git less ssh cmake \
18+
zip unzip gzip bzip2 \
19+
python3-tk gcc g++ libpq-dev
20+
21+
22+
RUN pip install -U pip && pip install -r requirements_${device}.txt
23+
RUN pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
24+
25+
COPY . /app
26+
WORKDIR /app
27+
ENV PYTHONPATH="${PYTHONPATH}:/app"
28+
#ENV STORAGE="S3"
29+
ENV DATABASE_URL="/app/db/botsim_sqlite_demo.db"
30+
31+
EXPOSE 8501
32+
ENTRYPOINT ["streamlit", "run", "/app/botsim/streamlit_app/app.py"]
33+
34+

LICENSE.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2022 Salesforce, Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
12+
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<p align="center">
2+
<br>
3+
<img src="docs/_static/logo.png" width="400"/>
4+
<br>
5+
<p>
6+
7+
<div align="center">
8+
<a href="https://github.com/salesforce/botsim/releases"><img alt="Latest Release" src="https://img.shields.io/github/release/salesforce/LAVIS.svg" /></a>
9+
<a href="https://opensource.salesforce.com/botsim/index.html">
10+
<img alt="docs" src="https://github.com/salesforce/LAVIS/actions/workflows/docs.yaml/badge.svg"/>
11+
<a href="https://opensource.org/licenses/BSD-3-Clause">
12+
<img alt="license" src="https://img.shields.io/badge/License-BSD_3--Clause-blue.svg"/>
13+
</a>
14+
</div>
15+
16+
<div align="center">
17+
<a href="https://arxiv.org/abs/2211.11982">System Demo Paper</a>,
18+
<a href="https://arxiv.org/abs/2211.11982">Technical Report</a>,
19+
<a href="https://salesforce-botsim.herokuapp.com/">Demo</a>,
20+
<a href="https://opensource.salesforce.com/botsim//latest/index.html">Documentation</a>,
21+
<a href="">Blog</a>
22+
</div>
23+
24+
25+
# BotSIM: An End-to-End Bot Simulation Toolkit for Commercial Task-Oriented Dialog Systems
26+
27+
28+
## Table of Contents
29+
1. [Introduction](#introduction)
30+
2. [Installation](#installation)
31+
3. [Getting Started](#getting-started)
32+
4. [Tutorials](#tutorial)
33+
4. [Documentation](#documentation)
34+
5. [System Demo Paper and Technical Report](#system-demo-paper-and-technical-report)
35+
36+
37+
## Introduction
38+
BotSIM is a Bot SIMulation toolkit for performing large-scale data-efficient end-to-end evaluation, diagnosis and remediation of commercial task-oriented dialog (TOD) systems to accelerate bot development and evaluation, reduce cost and time-to-market.
39+
As a modular framework, BotSIM can be extended by bot developers to support new bot platforms. As a toolkit, it offers an easy-to-use App and a suite of command line tools for bot admins or practitioners to readily perform evaluation and remediation of their bots.
40+
41+
Key features of BotSIM include:
42+
43+
- **Multi-stage bot evaluation**: BotSIM can be used for both pre-deployment testing and potentially post-deployment performance monitoring.
44+
- **Data-efficient dialogue generation**: Equipped with a deep network based paraphrasing model, BotSIM can generate an extensive set of test intent queries from the limited number of input intent utterances, which can be used to evaluate the bot intent model at scale.
45+
- **End-to-end bot evaluation via dialogue simulation**: Through automatic chatbot simulation, BotSIM can identify existing issues of the bot and evaluate both the natural language understanding (NLU) performance (for instance, intent or NER error rates) and the end-to-end dialogue performance such as goal completion rates.
46+
- **Bot health report dashboard**: The bot health report dashboard presents a multi-granularity top-down view of bot performance consisting of historical performance, current bot test performance and dialogue-specific performance. Together with the analytical tools, they help bot practitioners quickly identify the most urgent issues and properly plan their resources for troubleshooting.
47+
- **Easy extension to new bot platform**: BotSIM was built with a modular task-agnostic design, with multiple platform support in mind, so it can be easily extended to support new bot platforms. BotSIM currently supports [Salesforce Einstein BotBuilder](https://help.salesforce.com/s/articleView?id=sf.bots_service_intro.htm&type=5) and [Google DialogFlow CX](https://cloud.google.com/dialogflow/cx/docs/basics)
48+
49+
## Installation
50+
51+
1. (Optional) Creating conda environment
52+
```bash
53+
conda create -n botsim python=3.9
54+
conda activate botsim
55+
```
56+
57+
2. Cloning and building dependencies
58+
``` bash
59+
git clone https://github.com/salesforce/botsim.git
60+
cd BotSIM
61+
pip install .
62+
```
63+
64+
## Getting Started
65+
### Streamlit Web App
66+
The Streamlit Web App can be used to
67+
<p align="center" width="100%">
68+
<img width="100%" src="docs/BotSIM_App.png">
69+
</p>
70+
71+
The following commands can be used to run BotSIM as a Streamlit Web App locally:
72+
```bash
73+
export PYTHONPATH=./:$PYTHONPATH
74+
export DATABASE_URL="db/botsim_sqlite_demo.db"
75+
streamlit run botsim/streamlit_app/app.py
76+
```
77+
The App can also be deplpyed as a docker image:
78+
```
79+
# build the docker image
80+
docker build -t botsim-streamlit .
81+
# run the docker container
82+
docker run -p 8501:8501 botsim-streamlit
83+
```
84+
### Command Line Tools
85+
Alternatively, users can also use the command line tools to deep-dive into BotSIM's generation-simulation-remediation pipeline.
86+
87+
## Tutorial
88+
We provide the following tutorials in the tutorial section of the documentation.
89+
- Using Streamlit Web App
90+
- Using BotSIM command line tools
91+
- Navigating through bot health dashboard
92+
- Applying remedidation suggestions
93+
94+
## Documentation
95+
For more details of the system components and advanced usages, please refer to [code documentation]((https://opensource.salesforce.com/botsim//latest/index.html#)]).
96+
We welcome the contribution from the open-source community to improve the toolkit! To support new bot platforms, please also follow the guidelines detailed in the code documentation.
97+
98+
## System Demo Paper and Technical Report
99+
You can find more details in our technical report and system demo paper.
100+
If you're using BotSIM in your research or applications, please cite using this BibTeX for technical report:
101+
```
102+
@article{guangsen2022-botsim-tr,
103+
author = {Guangsen Wang and Shafiq Joty and Junnan Li and Steven Hoi},
104+
title = {BotSIM: An End-to-End Bot Simulation Toolkit for Commercial Task-Oriented Dialog Systems},
105+
year = {2022},
106+
doi = {},
107+
url = {},
108+
archivePrefix = {arXiv},
109+
}
110+
```
111+
or the following BibTex for our system demo paper:
112+
```
113+
@article{guangsen2022-botsim-demo,
114+
author = {Guangsen Wang and Samson Tan and Shafqi Joty and Guang Wu and Jimmy Au and Steven Hoi},
115+
title = {BotSIM: An End-to-End Bot Simulation Framework for Commercial Task-Oriented Dialog Systems},
116+
year = {2022},
117+
doi = {},
118+
url = {},
119+
archivePrefix = {arXiv},
120+
}
121+
```
122+
123+
## Contact Us
124+
Feel free to contact botsim@salesforce.com for any comments, issues or suggestions.
125+
126+
## License
127+
[BSD 3-Clause License](LICENSE.txt)

botsim/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2022, salesforce.com, inc.
2+
# All rights reserved.
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
5+

botsim/botsim_utils/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2022, salesforce.com, inc.
2+
# All rights reserved.
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
5+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Get the version."""
2+
3+
# Copyright (c) 2022, salesforce.com, inc.
4+
# All rights reserved.
5+
# SPDX-License-Identifier: BSD-3-Clause
6+
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7+
8+
# Third party
9+
import pkg_resources
10+
11+
try:
12+
__version__ = pkg_resources.get_distribution("clana").version
13+
except pkg_resources.DistributionNotFound:
14+
__version__ = "not installed"

0 commit comments

Comments
 (0)