https://github.com/biswesh456/simulated-dialog-generation
This is the code for the paper "Simulated Chats for Building Dialog Systems: Learning to GenerateConversations from Instructions" which got accepted in the Findings of EMNLP 2021.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Repository
This is the code for the paper "Simulated Chats for Building Dialog Systems: Learning to GenerateConversations from Instructions" which got accepted in the Findings of EMNLP 2021.
Basic Info
- Host: GitHub
- Owner: biswesh456
- License: apache-2.0
- Language: Jupyter Notebook
- Default Branch: main
- Size: 165 MB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Simulated-Dialog-Generation
This is the code for the paper "Simulated Chats for Building Dialog Systems: Learning to Generate Conversations from Instructions" published in the Findings of EMNLP 2021. [Paper Link]
Requirements
- Python 3.6
- spacy 2.1.4
- PyTorch 1.4.0
- transformers 2.11.0
Data Preprocessing
We have provided data.zip which contains data that is pre-processed. In order to pre-process the data manually follow the given procedure.
We have provided the delexicalised MultiWoz 2.1 data which can be found by unziping createData/multiwoz21.zip. We further convert the data to a format which could be sent as an input to our models. The final data has again been provided in data.zip but could also be generated using the following command(example for a low resource setting of 10% has been provided):
python build_query_result.py
python create_percentage_multiwoz_dataset.py --percentage 10
The pre-processed data produced is provided in data.zip.
The MultiWoz data was used from here.
Training the models on various dataset sizes
We train 5 models for each dataset size i.e. siamese network for agent, siamese network for user, belief state model(delexicalised), user dialog generator and agent dialog generator. The code shown below is for training the models on 10% of the data. We need to provide the path where the models need to be stored and the path of the data that is going to be used. All the models can be trained in the following way:
python codes/bert_siamese_agent/train_margin.py --data data/multiwiz/agent/10p --model models/siamese/agent/10p --num-epoch 5
python codes/bert_siamese/train_margin.py --data data/multiwiz/user/10p --model models/siamese/user/10p --num-epoch 5
python codes/gpt_agent/train.py --data data/multiwiz/agent/10p --model models/agent/10p --aug-type 'augmented' --num-epoch 10 --lr 0.00001
python codes/gpt/train.py --data data/multiwiz/user/10p --model models/user/10p --num-epoch 6 --aug-type 'augmented' --num-epoch 10 --lr 0.00001
python codes/gpt_query/train.py --data data/multiwiz/agent/10p --model models/query/10p_mod_del --num-epoch 10 --lr 0.000001 --delex
Creating artificial data
To create artificial data in artificialdata directory and combining the data with original data, run the following commands: ``` python createartificialgoals.py --percentage 10 python generateartificialdata.py --percenttage 10 --user-p 0.6 --agent-p 0.7 python combinesimulated_data.py --percentage 10 ```
Training end task model with augmented data
Here we train only 2 models i.e. belief state model and agent dialog generator. We train 2 models per dataset : 1) With augmented data 2) With original data(Note: we have already trained the agent model for generating artificial data. Although the belief state model was trained on delexicalised values which is not the case for final task. Hence we need to train belief state model again.)
The following commands help us in training the final models with augmented data:
python codes/gpt_agent/train.py --data data/multiwiz/agent/augmented_mixed_goal_10p --model models/agentfinal/augmented_mixed_goal_10+90p --aug-type 'augmented' --num-epoch 10 --lr 0.000005
python codes/gpt_query/train.py --data data/multiwiz/agent/augmented_mixed_goal_10p --model models/queryfinal/augmented_mixed_goal_10+90p --num-epoch 10 --lr 0.000001
Run the command to train lexicalised query model without augmented data:
python codes/gpt_query/train.py --data data/multiwiz/agent/10p --model models/query/10p --num-epoch 10 --lr 0.000001
Testing and evaluating
To test the model with augmented data with oracle belief state run the following command: ``` python3 codes/gptagent/test.py --model models/agentFinal/augmentedmixedgoal10+90p --data data/multiwiz/agent/100p --mname '' --best --prediction oracle_10+90p --type entire --prediction-dir predictions/
python evaluate.py --file oracle_10+90p.json ```
To test the model with augmented data with generated belief state run the following command: ``` python codes/gptagent/testquery.py --model models/agentFinal/augmentedmixedgoal10+90p --data data/multiwiz/agent/100p --mname '' --best --prediction generated10+90p --query-data models/queryFinal/augmentedmixedgoal_10+90p --type entire --prediction-dir predictions/
python evaluate.py --file generated_10+90p.json ```
To test the model without augmented data with oracle belief state run the following command: ``` python codes/gptagent/test.py --model models/agent/10p --data data/multiwiz/agent/100p --mname '' --best --prediction oracle10p --type entire --prediction-dir predictions/
python evaluate.py --file oracle_10p.json ```
To test the model without augmented data with generated belief state run the following command: ``` python3 codes/gptagent/testquery.py --model models/agent/10p --data data/multiwiz/agent/100p --mname '' --best --prediction generated_10p --query-data models/query/10p --type entire --prediction-dir predictions/
python evaluate.py --file generated_10p.json ```
Owner
- Name: Biswesh Mohapatra
- Login: biswesh456
- Kind: user
- Location: Paris
- Company: Inria
- Website: https://sites.google.com/view/biswesh-mohapatra/
- Twitter: bis1602
- Repositories: 8
- Profile: https://github.com/biswesh456
PhD student at INRIA Paris and affiliated with ENS(PSL)
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0