Skip to content
Snippets Groups Projects
Commit b9844398 authored by Hsien-Chin Lin's avatar Hsien-Chin Lin
Browse files

add example

parent ce7aca97
No related branches found
No related tags found
Loading
...@@ -9,7 +9,22 @@ The code of TUS is in `convlab2/policy/tus` and a rule-based DST of user is also ...@@ -9,7 +9,22 @@ The code of TUS is in `convlab2/policy/tus` and a rule-based DST of user is also
### Train the user simulator ### Train the user simulator
`python3 convlab2/policy/tus/multiwoz/train.py --user_config convlab2/policy/tus/multiwoz/exp/default.json` `python3 convlab2/policy/tus/multiwoz/train.py --user_config convlab2/policy/tus/multiwoz/exp/default.json`
One default configuration is placed in `convlab2/policy/tus/multiwoz/exp/default.json`
### Train a dialogue policy with TUS ### Train a dialogue policy with TUS
You can use it as a normal user simulator by `PipelineAgent`. For example,
```python
import json
from convlab2.dialog_agent.agent import PipelineAgent
from convlab2.dst.rule.multiwoz.usr_dst import UserRuleDST
from convlab2.policy.tus.multiwoz.TUS import UserPolicy
dst_usr = UserRuleDST()
user_config = json.load(open(args.user_config))
policy_usr = UserPolicy(user_config)
simulator = PipelineAgent(None, dst_usr, policy_usr, None, 'user')
```
<!---citation---> <!---citation--->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment