Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Make CCPE work #3487

Merged
merged 2 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 1 addition & 5 deletions parlai/tasks/ccpe/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ def _setup_data(self):
fpath = os.path.join(self.opt['datapath'], 'CCPE', 'ccpe.json')

with PathManager.open(fpath, 'r') as infile:
data = infile.read()
new_data = data.replace('}\n{', '},{')
json_data = json.loads(f'[{new_data}]')
json_data = json.load(infile)

flattenedData = []

for ep in range(len(json_data)):
currEp = []

entry = {}
currSegments = []
for i, utterance in enumerate(json_data[ep]['utterances']):
Expand Down
4 changes: 2 additions & 2 deletions parlai/tasks/ccpe/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

RESOURCES = [
DownloadableFile(
'https://storage.googleapis.com/dialog-data-corpus/CCPE-M-2019/data.json',
'https://raw.githubusercontent.com/google-research-datasets/ccpe/main/data.json',
'ccpe.json',
'4ff051ea7ea60cf0f480c911c7e2cfed56434e2e2c9ea8965ac5e26365773f0a',
zipped=False,
Expand All @@ -20,7 +20,7 @@

def build(opt):
dpath = os.path.join(opt['datapath'], 'CCPE')
version = '1.0'
version = '1.1'

if not build_data.built(dpath, version_string=version):
print('[building data: ' + dpath + ']')
Expand Down