Download src/preprocess/DSTC3.py from OpenDFM/DialogZoo: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/datasets/OpenDFM/DialogZoo/resolve/main/src/preprocess/DSTC3.py
- Command line
-
hf download hf://datasets/OpenDFM/DialogZoo/src/preprocess/DSTC3.py
-
curl -L -o DSTC3.py https://huggingface.co/datasets/OpenDFM/DialogZoo/resolve/main/src/preprocess/DSTC3.py
1 kB
| from utils import parse, write_jsonl_file, write_json_file | |
| from DSTC2 import preprocess | |
| import os | |
| if __name__ == "__main__": | |
| args = parse() | |
| # include DSTC2 training data | |
| train_data, ontology = preprocess( | |
| os.path.join(args.input_dir, "traindev"), | |
| args.output_dir, | |
| "dstc2_train", | |
| write=False, | |
| ) | |
| tourist_train_data, tourist_ontology = preprocess( | |
| os.path.join(args.input_dir, "seed"), | |
| args.output_dir, | |
| "dstc3_seed", | |
| domain="tourist", | |
| intent="FindPlaceToEat", | |
| write=False, | |
| ) | |
| train_data += tourist_train_data | |
| ontology.update(tourist_ontology) | |
| write_jsonl_file(train_data, os.path.join(args.output_dir, "dstc3_train.jsonl")) | |
| write_json_file(ontology, os.path.join(args.output_dir, "train_ontology.json")) | |
| preprocess( | |
| os.path.join(args.input_dir, "test"), | |
| args.output_dir, | |
| "dstc3_test", | |
| domain="tourist", | |
| intent="FindPlaceToEat", | |
| ) | |