Datasets:

Sub-tasks:
extractive-qa
Languages:
English
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
found
Annotations Creators:
no-annotation
Source Datasets:
original
ArXiv:
Tags:
License:
jonsaadfalcon commited on
Commit
8de1925
1 Parent(s): 288883a

updated scripts

Browse files
.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
- #with open('data/' + directory + "/" + file_type + "/" + question_type, 'r', encoding="utf-8") as f:
17
- # data = json.load(f)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- directory + "/" + file_type + "_" + question_type)
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:5666d62a333906d009270bf2ad1f96820f1be54939e7c7a10c11a5c4db87d19c
3
- size 361599
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:2eaf6137d0a9191a24f245775fb701be88276f6fb52aef65a80e0a369602069e
3
- size 121982
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:cb82673e7c392f74e1b0dbfdb5eadd52137c32141bef9cfe0d8131f72de95fb1
3
- size 337100
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:ff185f51c738bca834039063ca69e31683f9de21b0ea74f84cf667d1f67c00a0
3
- size 192294
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
- #"score": datasets.Value("int32"),views
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:5a16b0bd663dcc37b6df16514657beb09f13210bd719f19b2e7aa3141e4ad140
3
- size 1877876
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:be92516e59e833880619cc5a34068caed7a94cdd237907c97b177ea38aad94ff
3
- size 832440
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:b87e549daee5194eb44db0c7c2b11111d4b5b8101851e0e72fca3a1c0d2fed54
3
- size 1802600
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:0001d79059752ec5dff5cdd5ceb9df64eb36b7c32055a25a4c67e64c51929752
3
- size 1093531
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:4947b7cbc93cfb8020bceac1e198ca5bd71a65669faf3639de6100280c8a3780
3
- size 357288
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:74eb4fda728e12d08a155701d45cfefe2d95d941ef8522ee89acd7e303777c9c
3
- size 162653
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:03fb3b5ea7518fe59fabe632235b318d31361b9cd3960bea87584b4c904fca23
3
- size 298143
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:6b65d2926b6d37069cf289bc00e970df2e318264dc99ac50f8921970eb9a2036
3
- size 249309
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:06fafad5aa192fa5df5ef189f6c5dd6def38b20ca5ffbaa52526054627adf1ed
3
- size 360993
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:c473d923bb85324edf117a0651aeab8e1e36ca822b0d14f02afc61c9e0e40c71
3
- size 157028
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:ca108524de3eec5d5ea6ad72a0064444f8569037da83e02a00503e7093edbbd3
3
- size 385766
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:b7f396e9068ab303a536d5f2464b0d2c46baa7de5a87ef4de71ebe55cfd0828e
3
- size 180291
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:f3c6b9a4a56957da3c89f8ce6ce30ea8b76f1772d6b2e405b1f1e581de678ba7
3
- size 380956
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:b224e2ca11e178454d891b1453958f7a39875fd9a3e52a3d7a7a7129ea27c623
3
- size 252078
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:9c3530af0c9c82f2fcee994110e443e335c3935919c6387d2b89354fb35b0faf
3
- size 378009
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:4f00fa3bbbc23e0575eed4ddf23f3df16ae1c3f3df4075bfb100c38c67755daf
3
- size 172318
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:d372aa3721caa061fd588b1112cc521c4dfe6dae87b1a4609f2660036998ca4a
3
- size 369500
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:8970173297af9f934676ab28643f0c70bd15b53193edd1ff40a7a428d4671b76
3
- size 130899
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:4a2c662ed2bfc2a560be8502608199c210c842f2914a9883690c4ae9ec53cb97
3
- size 344815
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:181e57289cf99506833ecc6e2413cac0ef204cf4a79ce29273da09a757c4dbfa
3
- size 288272
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21276945872c578470b2e97fb570e64227c8236a9154b7af1407eff2eccc37c9
3
+ size 315010