Skip to main content

Simtester

License arXiv

Simtester is an open-source toolkit for evaluating user simulator of task-oriented dialogue system(TOD). It is developed based on Python and PyTorch. You can easily construct agents(system variants) with Simtester using either your own implemented model or our trained model and construct tester with different combinations of agents. In tester-based evaluation, the user simulator you implemented interacts with agents in the tester, ranks them, and tester calculates the Exact Distinct score of the user simulator. [paper]

Simtester

Installation

Simtester works with the following operating systems:

  • Linux
  • Windows 10
  • macOS X

Simtester requires Python version 3.6 or later.

You can install Simtester from source:

git clone https://github.com/Superbooming/simtester && cd simtester
pip install -e .

We will upload Simtester to pypi soon.

Quick-Start

When you construct a agent using your own implemented model, you should fill your model instance your_model and your model interact function your_model_interact_fn which input the dialogue context and output the response.

When you construct a agent using own trained model, you should download model first(link in Models). You should fill the model name and the responding model directory which store the model you download and the remaining configuration will be loaded according to default config file(in simtester/config/multiwoz/). Or you can fill your own config file(.yaml format) path and the config file should include the model name and the responding model directory.See the config file example in simtester/config/multiwoz/soloist-base.yaml.

# construct a agent using your own implemented model 
from simtester import Agent
agent = Agent(your_model, your_model_interact_fn)

# construct a gent using our trained model
from simtester import MultiWOZAgent
agent = MultiWOZAgent('soloist-base', 'model/soloist-base') # fill model name and model directory
agent = MultiWOZAgent(config='simtester/config/multiwoz.soloist-base.yaml') # fill config path

# interact with agent and get the response
resopnse = agent.interact('I want to book a resturant in the center of city.')

# get dialogue context and start a new dialogue
agent.get_context()
agent.start_dialogue()

When you construct a tester using your own agents, you should fill your agent list which includes your own agent instance and the ground truth agent rank where a smaller number indicates a higher rank. If rank is not filled, the number is default to incremented.

When you construct a agent with strategy we provided, you can just fill the strategy name.

When you interact with tester, you can either input the utterance list, or the rank your simulator predicts. If the utterance list is input, tester will return the response list which includes response responding to each agent and the dialogue state list which indicates whether each agent ends the dialog. You can set the end_token of tester and when the agent receives response which includes the end_token, the agent's dialogue will be ended. If the rank your simulator predicts is input, tester will compare the ground truth rank with input rank and return the result. Notice that the input of the rank represents the end of the dialogue for all agents, and a new round of dialogue will start.

from simtester import Tester

# construct tester with your own agents
tester = Tester([agentA, agentB, agentC], [2, 1, 3])

# construct tester with strategy we provided
tester = Tester('context-tester')

# interact with tester
tester.interact(['I want to book a resturant.', 
                 'I want to book a hotel.', 
                 'I want to find a attraction.'])
tester.interact(rank=[2, 3, 1])

# get current tester information and exact distinct score
tester.get_info()
tester.get_score()

# reset tester
tester.reset()

Contributions

Please let us know if you encounter a bug or have any suggestions by filing an issue.

We welcome all contributions from bug fixes to new features and extensions.

We expect all contributions discussed in the issue tracker and going through PRs.

Citing

If you find Simtester useful for your research or development, please cite our Paper:

@article{sun2022metaphorical,
  title={Metaphorical User Simulators for Evaluating Task-oriented Dialogue Systems},
  author={Sun, Weiwei and Guo, Shuyu and Zhang, Shuo and Ren, Pengjie and Chen, Zhumin and de Rijke, Maarten and Ren, Zhaochun},
  journal={arXiv preprint arXiv:2204.00763},
  year={2022}
}

Team

Simtester was developed and maintained by Shandong University IR Lab.

License

Simtester uses MIT License.

Metadata

Release files for simtester 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simtester 0.1.0
File Size Uploaded
simtester-0.1.0.tar.gz 28.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simtester 0.1.0
File Interpreter ABI Platform
simtester-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.1 kB

Release files / simtester-0.1.0.tar.gz

Download URL simtester-0.1.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3a57d0b18efaf09da8184b2e8ef5409774c63051ceea9afb6d85e4a6dfe4b554
BLAKE2b-256 checksum
How to use checksums
840605216a53f0b0742fe7859f035d18e1d6870c80569981308c53094decea77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.8

Release files / simtester-0.1.0-py3-none-any.whl

Download URL simtester-0.1.0-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8000f0bdd4136fa061faba89bd1a94592c6ca0ae0e582be70f6bb70563a009f1
BLAKE2b-256 checksum
How to use checksums
d405be4f63fd9eae79d7bf063cd5548d2747a03ac874ac24e1c2265961a998cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page