{"id":16269785,"url":"https://github.com/sea-snell/calm-dialogue","last_synced_at":"2025-10-02T20:30:21.826Z","repository":{"id":41220658,"uuid":"481328097","full_name":"Sea-Snell/CALM-Dialogue","owner":"Sea-Snell","description":"Official code for the paper \"Context-Aware Language Modeling for Goal-Oriented Dialogue Systems\"","archived":false,"fork":false,"pushed_at":"2022-12-09T18:12:18.000Z","size":60,"stargazers_count":34,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-12T21:33:25.311Z","etag":null,"topics":["deep-learning","language-model","nlp","python","pytorch","reinforcement-learning"],"latest_commit_sha":null,"homepage":"https://sea-snell.github.io/CALM_LM_site/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sea-Snell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-13T18:20:56.000Z","updated_at":"2024-06-17T20:26:41.000Z","dependencies_parsed_at":"2023-01-25T18:01:20.281Z","dependency_job_id":null,"html_url":"https://github.com/Sea-Snell/CALM-Dialogue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sea-Snell%2FCALM-Dialogue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sea-Snell%2FCALM-Dialogue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sea-Snell%2FCALM-Dialogue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sea-Snell%2FCALM-Dialogue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sea-Snell","download_url":"https://codeload.github.com/Sea-Snell/CALM-Dialogue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235039170,"owners_count":18926302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","language-model","nlp","python","pytorch","reinforcement-learning"],"created_at":"2024-10-10T18:09:08.957Z","updated_at":"2025-10-02T20:30:16.540Z","avatar_url":"https://github.com/Sea-Snell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Context-Aware Language Modeling for Goal-Oriented Dialogue Systems\n\nOfficial code for the paper \"Context-Aware Language Modeling for Goal-Oriented Dialogue Systems\"\n\n[project site](https://sea-snell.github.io/CALM_LM_site/) | [arxiv](https://arxiv.org/abs/2204.10198)\n\n## **setup**\n\n1. create conda environment: `conda create --name CALM python=3.9.7`\n2. activate conda environment: `conda activate CALM`\n3. install requirements: `pip install -r requirements.txt`\n4. install pytorch 1.9.0: `conda install pytorch==1.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge`\n5. `export PYTHONPATH=\"$PWD/offline_airdialogue\"`\n6. Download the processed data and model checkpoints [here](https://drive.google.com/drive/folders/1mnAGcgqyQC3ygILwwf-llxLf70nT9AT9?usp=sharing). The `outputs/` folder contains checkpoints for our main model, our task pretrained model, and our customer bot.\n\n## **Training**\n   *(Note: all training runs use wandb by default, you can turn off wandb syncing in the config.)*\n* `cd scripts/train`\n* To run data-parallel multi-GPU training, on any of the commands below replace `python \u003cscript_path\u003e` with `python -m torch.distributed.launch --nproc_per_node \u003cn_GPUs\u003e --use_env \u003cscript_path\u003e`.\n\n* **Pretraining CALM**\u003cbr\u003e\n    *(two variants of the auxiliary loss function)*\n\n    * \n        script: `python train_pretrain_table_agent.py`\u003cbr\u003e\n        config: `config/train_pretrain_table_agent.yaml`\n\n    * \n        script: `python train_pretrain_simplified_aux_gpt2.py`\u003cbr\u003e\n        config: `config/train_pretrain_simplified_aux_gpt2.yaml`\n\n* **Training the customer bot**\n\n    * \n        script: `python train_customer.py`\u003cbr\u003e\n        config: `config/train_customer_bot.yaml`\n\n* **Training CALM**\u003cbr\u003e\n    *(two variants of the auxiliary loss function)*\n\n    * \n        script: `python train_real_table_agent.py`\u003cbr\u003e\n        config: `config/train_real_table_agent.yaml`\n\n    * \n        script: `python train_simplified_aux_gpt2.py`\u003cbr\u003e\n        config: `config/train_simplified_aux_agent.yaml`\n\n* **Training Standard LM**\n    \n    *\n        script: `python train_basic_agent.py`\u003cbr\u003e\n        config: `config/train_basic_agent.yaml`\n\n* **Training the reward model for Model Based Rollout Planning**\n\n    *\n        script: `python train_constraint_parser.py`\u003cbr\u003e\n        config: `config/train_constraint_parser.yaml`\n\n## Evaluating\n\n* `cd scripts/eval`\n\n* **Simulated Evaluation**\n\n    *\n        script: `python selfplay_eval.py`\u003cbr\u003e\n        config: `config/selfplay_eval.yaml`\u003cbr\u003e\u003cbr\u003e\n        * A log of results will be saved to the location specified by `selfplay/outputs_file` in the config. To print out the success rate for the selfplay run: `python compute_results.py --results_file \u003cyour_eval_outputs_file\u003e`\u003cbr\u003e\u003cbr\u003e\n        * Note: selfplay evaluation will by default use all the GPUs available on your machine. To Specify which GPUs to use, prefix the command with `CUDA_VISIBLE_DEVICES=\u003ccomma_seperated_list_of_gpu_indicies\u003e`\n\n* **Language Quality Evaluation**\n\n    *\n        script: `python language_quality_eval.py`\u003cbr\u003e\n        config: `config/language_eval.yaml`\u003cbr\u003e\u003cbr\u003e\n        * To parallelize evaluation across on multiple-GPUs, run: `python -m torch.distributed.launch --nproc_per_node \u003cn_GPUs\u003e --use_env language_quality_eval.py`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsea-snell%2Fcalm-dialogue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsea-snell%2Fcalm-dialogue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsea-snell%2Fcalm-dialogue/lists"}