Datasets:
lmqg
/

Languages:
Chinese
Multilinguality:
monolingual
Size Categories:
10K<n<100K
ArXiv:
License:
asahi417 commited on
Commit
87b3f07
1 Parent(s): 40be2cd
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:2c97be8ad690988b11ae238bdbb26da763b28334ab6894185337037fa69b2c0d
3
- size 38396960
 
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:8debcac1fbd7bc09cad41e51fa2a87b77cb69723460a70fbc167bb4431a82427
3
- size 279350289
 
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:04ba1bbd2cc7af963535d98dbbb86ed44f99748355f1243c3ff9b4c8fc7dc3d8
3
- size 39458227
 
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.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,