Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
Japanese
Size:
10K - 100K
ArXiv:
Tags:
question-generation
License:
update
Browse files
generate_reference_files.py
CHANGED
@@ -9,10 +9,7 @@ for split in ['validation', 'test']:
|
|
9 |
dataset = load_dataset('asahi417/qg_jaquad', split=split, download_mode='force_redownload')
|
10 |
for data in ['question', 'answer', 'sentence', 'paragraph']:
|
11 |
with open('./reference_files/{}-{}.txt'.format(data, split), 'w') as f:
|
12 |
-
|
13 |
-
tmp_data = dataset['paragraph_id']
|
14 |
-
else:
|
15 |
-
tmp_data = dataset[data]
|
16 |
f.write('\n'.join([i.replace('\n', '') for i in tmp_data]))
|
17 |
length = [len(open(i).read().split('\n')) for i in glob(f'reference_files/*{split}.txt')]
|
18 |
assert len(list(set(length))) == 1, length
|
|
|
9 |
dataset = load_dataset('asahi417/qg_jaquad', split=split, download_mode='force_redownload')
|
10 |
for data in ['question', 'answer', 'sentence', 'paragraph']:
|
11 |
with open('./reference_files/{}-{}.txt'.format(data, split), 'w') as f:
|
12 |
+
tmp_data = dataset[data]
|
|
|
|
|
|
|
13 |
f.write('\n'.join([i.replace('\n', '') for i in tmp_data]))
|
14 |
length = [len(open(i).read().split('\n')) for i in glob(f'reference_files/*{split}.txt')]
|
15 |
assert len(list(set(length))) == 1, length
|