Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update preprocess.py #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import os
import json

from argparse import ArgumentParser
Expand Down Expand Up @@ -170,7 +170,10 @@ def preprocess(args):
path = './data/ConvAI2/convai2_tokenized/' if not args.roberta else './data/ConvAI2/convai2_roberta_tokenized/'
else:
path = './data/ECDT2019/ecdt2019_tokenized/'

if not os.path.exists(path):
# for the FileNotFoundError: [Errno 2] No such file or directory: './data/ECDT2019/ecdt2019_tokenized/train_persona.json',
# when first running this code.
os.makedirs(path)
print(f"Saving tokenized dict at {path}")

with open(path+'train_persona.json','w') as train_persona:
Expand Down