Datasets:
Tasks:
Question Answering
Modalities:
Text
Sub-tasks:
extractive-qa
Languages:
English
Size:
10K - 100K
ArXiv:
License:
Commit
•
8de1925
1
Parent(s):
288883a
updated scripts
Browse files- .DS_Store +0 -0
- Generate_JSON_From_TSV.py +40 -4
- lifestyle/dev_qas.forum.jsonl +2 -2
- lifestyle/dev_qas.search.jsonl +2 -2
- lifestyle/test_qas.forum.jsonl +2 -2
- lifestyle/test_qas.search.jsonl +2 -2
- lotte.py +2 -2
- pooled/dev_qas.forum.jsonl +2 -2
- pooled/dev_qas.search.jsonl +2 -2
- pooled/test_qas.forum.jsonl +2 -2
- pooled/test_qas.search.jsonl +2 -2
- recreation/dev_qas.forum.jsonl +2 -2
- recreation/dev_qas.search.jsonl +2 -2
- recreation/test_qas.forum.jsonl +2 -2
- recreation/test_qas.search.jsonl +2 -2
- science/dev_qas.forum.jsonl +2 -2
- science/dev_qas.search.jsonl +2 -2
- science/test_qas.forum.jsonl +2 -2
- science/test_qas.search.jsonl +2 -2
- technology/dev_qas.forum.jsonl +2 -2
- technology/dev_qas.search.jsonl +2 -2
- technology/test_qas.forum.jsonl +2 -2
- technology/test_qas.search.jsonl +2 -2
- writing/dev_qas.forum.jsonl +2 -2
- writing/dev_qas.search.jsonl +2 -2
- writing/test_qas.forum.jsonl +2 -2
- writing/test_qas.search.jsonl +2 -2
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
Generate_JSON_From_TSV.py
CHANGED
@@ -9,18 +9,54 @@ directories = ['lifestyle', 'pooled', 'recreation', 'science', 'technology', 'wr
|
|
9 |
|
10 |
for directory in directories:
|
11 |
|
|
|
|
|
12 |
for file_type in ["dev", "test"]:
|
13 |
|
14 |
for question_type in ["qas.forum.jsonl", "qas.search.jsonl"]:
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
if not os.path.isdir(directory):
|
20 |
os.mkdir(directory)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
#with open(directory + "/" + file_type + question_type, 'w', encoding="utf-8") as fout:
|
23 |
# json.dump(data, fout)
|
24 |
|
25 |
-
shutil.move('data/' + directory + "/" + file_type + "/" + question_type,
|
26 |
-
|
|
|
9 |
|
10 |
for directory in directories:
|
11 |
|
12 |
+
print("Starting " + directory)
|
13 |
+
|
14 |
for file_type in ["dev", "test"]:
|
15 |
|
16 |
for question_type in ["qas.forum.jsonl", "qas.search.jsonl"]:
|
17 |
|
18 |
+
if directory != 'pooled':
|
19 |
+
|
20 |
+
with open('data/' + directory + "/" + file_type + "/metadata.jsonl", 'r', encoding="utf-8") as json_file:
|
21 |
+
metadata = list(json_file)
|
22 |
+
|
23 |
+
question_id_to_author = {}
|
24 |
+
|
25 |
+
for json_str in metadata:
|
26 |
+
current_row = json.loads(json_str)
|
27 |
+
question_id_to_author[current_row["question_id"]] = current_row["question_author"]
|
28 |
+
|
29 |
+
else:
|
30 |
+
|
31 |
+
question_id_to_author = {}
|
32 |
+
|
33 |
+
########################################################
|
34 |
+
|
35 |
+
with open(directory + "/" + file_type + "_" + question_type, 'r', encoding="utf-8") as json_file:
|
36 |
+
json_list = list(json_file)
|
37 |
+
|
38 |
+
revised_jsonl = []
|
39 |
+
|
40 |
+
for json_str in tqdm(json_list):
|
41 |
+
current_row = json.loads(json_str)
|
42 |
+
try:
|
43 |
+
current_row["question_author"] = question_id_to_author[current_row['qid']]
|
44 |
+
except:
|
45 |
+
current_row["question_author"] = ""
|
46 |
+
revised_jsonl.append(current_row)
|
47 |
+
|
48 |
+
########################################################
|
49 |
|
50 |
if not os.path.isdir(directory):
|
51 |
os.mkdir(directory)
|
52 |
|
53 |
+
with open(directory + "/" + file_type + "_" + question_type, 'w', encoding="utf-8") as outfile:
|
54 |
+
for entry in revised_jsonl:
|
55 |
+
json.dump(entry, outfile)
|
56 |
+
outfile.write('\n')
|
57 |
+
|
58 |
#with open(directory + "/" + file_type + question_type, 'w', encoding="utf-8") as fout:
|
59 |
# json.dump(data, fout)
|
60 |
|
61 |
+
#shutil.move('data/' + directory + "/" + file_type + "/" + question_type,
|
62 |
+
# directory + "/" + file_type + "_" + question_type)
|
lifestyle/dev_qas.forum.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:547f0047d4c4b3f99ee0859e588727a30a4f82f694199417b9c3ed8eeb6e4ee8
|
3 |
+
size 426225
|
lifestyle/dev_qas.search.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:a67be736efa5a7961d4bb2a768ae3efc3c195d163541b665581919cd21ae9d3f
|
3 |
+
size 135512
|
lifestyle/test_qas.forum.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:65ec46e9687d76fb7da9bdc9fb259bd7388a2c52b1f5efdd3b5c760587807624
|
3 |
+
size 392538
|
lifestyle/test_qas.search.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:4215b80512270e328c0f267b5b4b60b4a8914e34d4b5182994822acc53cdd539
|
3 |
+
size 210658
|
lotte.py
CHANGED
@@ -119,8 +119,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
119 |
{
|
120 |
"qid": datasets.Value("int32"),
|
121 |
"query": datasets.Value("string"),
|
122 |
-
|
123 |
-
#"views": datasets.Value("int32"),
|
124 |
"answers": datasets.Sequence(feature={"views": datasets.Value(dtype='int32', id=None),
|
125 |
"score": datasets.Value(dtype='int32', id=None),
|
126 |
"answer_pids": datasets.Value(dtype='int32', id=None)})
|
@@ -197,5 +196,6 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
197 |
yield key, {
|
198 |
"qid": data["qid"],
|
199 |
"query": data["query"],
|
|
|
200 |
"answers": answers
|
201 |
}
|
|
|
119 |
{
|
120 |
"qid": datasets.Value("int32"),
|
121 |
"query": datasets.Value("string"),
|
122 |
+
"author": datasets.Value("string"),
|
|
|
123 |
"answers": datasets.Sequence(feature={"views": datasets.Value(dtype='int32', id=None),
|
124 |
"score": datasets.Value(dtype='int32', id=None),
|
125 |
"answer_pids": datasets.Value(dtype='int32', id=None)})
|
|
|
196 |
yield key, {
|
197 |
"qid": data["qid"],
|
198 |
"query": data["query"],
|
199 |
+
"author": data["author"],
|
200 |
"answers": answers
|
201 |
}
|
pooled/dev_qas.forum.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:3787acc2fb866d2e162815fba4159c1656eef50da4e34dddbee3bebfce27eaa4
|
3 |
+
size 2111337
|
pooled/dev_qas.search.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:371311e96eaa17c706944a6dbd0c5d06c8558b0347806053110424a5c865d62b
|
3 |
+
size 899856
|
pooled/test_qas.forum.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:338f0cbcf07c8be1fa51cd9c09a76597d0e221c906ce1006008409bddeb47d58
|
3 |
+
size 2035076
|
pooled/test_qas.search.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:47d69255519dfe754752b4b85ece19dc84cabf45310a50686b32b8018dd6ed3c
|
3 |
+
size 1182521
|
recreation/dev_qas.forum.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:b7781efdf3bb212423fd86d4100dba32e70e478b5c8812d830b15278c612a60e
|
3 |
+
size 413764
|
recreation/dev_qas.search.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:62e1493346982aef59a7d56ab29bcb7452f0844ce8c6a397586255242ebef7a3
|
3 |
+
size 178806
|
recreation/test_qas.forum.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:02bc3c158485b4195f7500f7e5f983096875a32eb8e582db46adff8f29aad911
|
3 |
+
size 353276
|
recreation/test_qas.search.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:ea28b4ac82904db9452ec94b13718fd7b479d8a2378ce02ad619a876f682c6cf
|
3 |
+
size 275367
|
science/dev_qas.forum.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:f929396d93d4e3c2058033dd65714b1f6205732d853b4ff97e310a59558a64f9
|
3 |
+
size 422340
|
science/dev_qas.search.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:73a191b46bb59e1c4d0c7328d74583f0422a303b72b0b729914ea51c089c9a38
|
3 |
+
size 173684
|
science/test_qas.forum.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:7ade8bca406b097ba3e4b9908ffd8241111629bcb15320144225cc5809e977f3
|
3 |
+
size 443622
|
science/test_qas.search.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:5c80f6ed2e517f08739278ce0585dc2a3986815b929fa9a219c491556f04c9fb
|
3 |
+
size 197738
|
technology/dev_qas.forum.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:2b4890cb5f8c693f1e7778fa104d538dc7134004d2cfaedbffbc87191b322c04
|
3 |
+
size 438461
|
technology/dev_qas.search.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:13757b60a97ec2cb718f9a777a3af2ea815afcd6971c1f3d3449e5af5609d569
|
3 |
+
size 278706
|
technology/test_qas.forum.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:2ae44ce8f311e02ea4b2c99198d8b02a9830a57c8ce45b4880a9ebe4e71f7040
|
3 |
+
size 438881
|
technology/test_qas.search.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:c6df31ea50dd284eb80383339687844480d8ddaa5ee72a94a46ec72ae78c41d5
|
3 |
+
size 190032
|
writing/dev_qas.forum.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:d780993e0ab707c097c6001d88a05fd29c4e4a8222428e40c714884bb8f795f1
|
3 |
+
size 428332
|
writing/dev_qas.search.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:a272aca0019c815d4916647eb21436192d72028e7e99d9c5cd036133cf4eb207
|
3 |
+
size 145596
|
writing/test_qas.forum.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:62763613850de9b85decf65f0363d5a865d471f0f8810562019261cd7dd5a5b1
|
3 |
+
size 395913
|
writing/test_qas.search.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:21276945872c578470b2e97fb570e64227c8236a9154b7af1407eff2eccc37c9
|
3 |
+
size 315010
|