Datasets:
Tasks:
Text Generation
Sub-tasks:
language-modeling
Languages:
Chinese
Size:
10K<n<100K
ArXiv:
Tags:
question-generation
License:
init
Browse files- add_question_answer.py +11 -0
- data/processed/test.jsonl +2 -2
- data/processed/train.jsonl +2 -2
- data/processed/validation.jsonl +2 -2
- process.py +1 -0
- qg_zhquad.py +1 -1
add_question_answer.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
for i in ["test.jsonl", "train.jsonl", "validation.jsonl"]:
|
4 |
+
with open(f"data/processed/{i}") as f:
|
5 |
+
tmp = [json.loads(l) for l in f.read().split("\n") if len(l) > 0]
|
6 |
+
print(len(tmp))
|
7 |
+
for x in tmp:
|
8 |
+
x["paragraph_question"] = f"question: {x['question']}, context: {x['paragraph']}"
|
9 |
+
input()
|
10 |
+
with open(f"data/processed/{i}", "w") as f:
|
11 |
+
f.write("\n".join([json.dumps(x) for x in tmp]))
|
data/processed/test.jsonl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e1205d6961e6dc3d29b5d0dcb2ded701142ccbc0acc30301338b6ac3d5304b1b
|
3 |
+
size 50055350
|
data/processed/train.jsonl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df4567832c759b0cec43566f4779715d8eec61a501bf7b2fd47f3eb8e2a069d0
|
3 |
+
size 364050763
|
data/processed/validation.jsonl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:079afd8cabdc1800f06be06b6d1ca268b09f1dc2e8b470e3adeeb26ae3f02054
|
3 |
+
size 51420524
|
process.py
CHANGED
@@ -70,6 +70,7 @@ def process_single_data(data: Dict):
|
|
70 |
example['paragraph'][:position], HIGHLIGHT_TOKEN, example['answer'],
|
71 |
example['paragraph'][position + len(example['answer']):])
|
72 |
example['paragraph_answer'] = re.sub(r'\s+', ' ', source_text)
|
|
|
73 |
|
74 |
# get sentence_answer
|
75 |
if len(before_tmp) == 0 or before_tmp[-1].endswith('.'):
|
|
|
70 |
example['paragraph'][:position], HIGHLIGHT_TOKEN, example['answer'],
|
71 |
example['paragraph'][position + len(example['answer']):])
|
72 |
example['paragraph_answer'] = re.sub(r'\s+', ' ', source_text)
|
73 |
+
# example['paragraph_question'] = f"question: {example['question']}, context: {example['paragraph']}"
|
74 |
|
75 |
# get sentence_answer
|
76 |
if len(before_tmp) == 0 or before_tmp[-1].endswith('.'):
|
qg_zhquad.py
CHANGED
@@ -3,7 +3,7 @@ import json
|
|
3 |
import datasets
|
4 |
|
5 |
logger = datasets.logging.get_logger(__name__)
|
6 |
-
_VERSION = "0.0.
|
7 |
_NAME = "qg_zhquad"
|
8 |
_CITATION = """
|
9 |
@inproceedings{ushio-etal-2022-generative,
|
|
|
3 |
import datasets
|
4 |
|
5 |
logger = datasets.logging.get_logger(__name__)
|
6 |
+
_VERSION = "0.0.1"
|
7 |
_NAME = "qg_zhquad"
|
8 |
_CITATION = """
|
9 |
@inproceedings{ushio-etal-2022-generative,
|