Datasets:
Tasks:
Text Generation
Sub-tasks:
language-modeling
Languages:
Italian
Size:
10K<n<100K
ArXiv:
Tags:
question-generation
License:
model update
Browse files- generate_reference_files.py +0 -20
- reference_files/answer-test.txt +0 -0
- reference_files/answer-validation.txt +0 -0
- reference_files/paragraph-test.txt +0 -0
- reference_files/paragraph-validation.txt +0 -0
- reference_files/question-test.txt +0 -0
- reference_files/question-validation.txt +0 -0
- reference_files/sentence-test.txt +0 -0
- reference_files/sentence-validation.txt +0 -0
generate_reference_files.py
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
from glob import glob
|
3 |
-
from datasets import load_dataset
|
4 |
-
|
5 |
-
os.makedirs('./reference_files', exist_ok=True)
|
6 |
-
|
7 |
-
|
8 |
-
for split in ['validation', 'test']:
|
9 |
-
dataset = load_dataset('asahi417/qg_itquad', 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 |
-
if data == 'paragraph':
|
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 |
-
|
18 |
-
length = [len(open(i).read().split('\n')) for i in glob(f'reference_files/*{split}.txt')]
|
19 |
-
assert len(list(set(length))) == 1, length
|
20 |
-
assert length[0] == len(dataset), f"{length[0]} != {len(dataset)}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reference_files/answer-test.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/answer-validation.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/paragraph-test.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/paragraph-validation.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/question-test.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/question-validation.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/sentence-test.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
reference_files/sentence-validation.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|