Datasets:
Tasks:
Question Answering
Sub-tasks:
extractive-qa
Languages:
English
Size:
1M<n<10M
ArXiv:
License:
Commit
·
64d4080
1
Parent(s):
5f084e3
updated lotte_passages.py
Browse files- .DS_Store +0 -0
- Generate_JSON_From_Collection_TSV.py +26 -1
- lifestyle/dev_collection.jsonl +2 -2
- lifestyle/test_collection.jsonl +2 -2
- lotte_passages.py +7 -0
- pooled/dev_collection.jsonl +2 -2
- pooled/test_collection.jsonl +2 -2
- recreation/dev_collection.jsonl +2 -2
- recreation/test_collection.jsonl +2 -2
- science/dev_collection.jsonl +2 -2
- science/test_collection.jsonl +2 -2
- technology/dev_collection.jsonl +2 -2
- technology/test_collection.jsonl +2 -2
- writing/dev_collection.jsonl +2 -2
- writing/test_collection.jsonl +2 -2
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
Generate_JSON_From_Collection_TSV.py
CHANGED
|
@@ -10,6 +10,30 @@ for directory in directories:
|
|
| 10 |
|
| 11 |
for file_type in ["dev", "test"]:
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
current_jsonl = []
|
| 14 |
loaded_file = pd.read_csv('data/' + directory + "/" + file_type + "/collection.tsv", sep='\t', header=0)
|
| 15 |
|
|
@@ -17,6 +41,7 @@ for directory in directories:
|
|
| 17 |
|
| 18 |
current_jsonl.append({
|
| 19 |
"doc_id": row,
|
|
|
|
| 20 |
"text": loaded_file.iloc[row][1]
|
| 21 |
})
|
| 22 |
|
|
@@ -25,4 +50,4 @@ for directory in directories:
|
|
| 25 |
os.mkdir(directory)
|
| 26 |
|
| 27 |
with open(directory + "/" + file_type + "_collection.jsonl", 'w', encoding="utf-8") as fout:
|
| 28 |
-
json.dump(current_jsonl, fout)
|
|
|
|
| 10 |
|
| 11 |
for file_type in ["dev", "test"]:
|
| 12 |
|
| 13 |
+
if directory != 'pooled':
|
| 14 |
+
|
| 15 |
+
with open('data/' + directory + "/" + file_type + "/metadata.jsonl", 'r', encoding="utf-8") as json_file:
|
| 16 |
+
metadata = list(json_file)
|
| 17 |
+
|
| 18 |
+
post_id_to_author = {}
|
| 19 |
+
|
| 20 |
+
for json_str in metadata:
|
| 21 |
+
current_row = json.loads(json_str)
|
| 22 |
+
current_post_ids = current_row['post_ids']
|
| 23 |
+
current_post_authors = current_row['post_authors']
|
| 24 |
+
|
| 25 |
+
for post_id, author in zip(current_post_ids, current_post_authors):
|
| 26 |
+
post_id_to_author[post_id] = author
|
| 27 |
+
|
| 28 |
+
else:
|
| 29 |
+
|
| 30 |
+
from collections import defaultdict
|
| 31 |
+
def default_value():
|
| 32 |
+
return ""
|
| 33 |
+
post_id_to_author = defaultdict(default_value)
|
| 34 |
+
|
| 35 |
+
#####################################################################################
|
| 36 |
+
|
| 37 |
current_jsonl = []
|
| 38 |
loaded_file = pd.read_csv('data/' + directory + "/" + file_type + "/collection.tsv", sep='\t', header=0)
|
| 39 |
|
|
|
|
| 41 |
|
| 42 |
current_jsonl.append({
|
| 43 |
"doc_id": row,
|
| 44 |
+
"author": post_id_to_author[row],
|
| 45 |
"text": loaded_file.iloc[row][1]
|
| 46 |
})
|
| 47 |
|
|
|
|
| 50 |
os.mkdir(directory)
|
| 51 |
|
| 52 |
with open(directory + "/" + file_type + "_collection.jsonl", 'w', encoding="utf-8") as fout:
|
| 53 |
+
json.dump(current_jsonl, fout)
|
lifestyle/dev_collection.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:619ca034d86e28d11de74e5e17a1d7807af0dc4f846a4ee9c4b17a9a002192a5
|
| 3 |
+
size 273115383
|
lifestyle/test_collection.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:f2c24cb284eb333d507c0157f44bc7a4a4a23a5f61104900f7405ec1a80f499c
|
| 3 |
+
size 110087236
|
lotte_passages.py
CHANGED
|
@@ -118,6 +118,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
| 118 |
features = datasets.Features(
|
| 119 |
{
|
| 120 |
"doc_id": datasets.Value("int32"),
|
|
|
|
| 121 |
"text": datasets.Value("string")
|
| 122 |
}
|
| 123 |
)
|
|
@@ -170,10 +171,16 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
| 170 |
|
| 171 |
data = json.loads(row)
|
| 172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
for i in range(0, len(data)):
|
| 174 |
|
| 175 |
current_query = data[i]
|
| 176 |
yield i, {
|
| 177 |
"doc_id": current_query["doc_id"],
|
|
|
|
| 178 |
"text": current_query["text"]
|
| 179 |
}
|
|
|
|
| 118 |
features = datasets.Features(
|
| 119 |
{
|
| 120 |
"doc_id": datasets.Value("int32"),
|
| 121 |
+
"author": datasets.Value("string"),
|
| 122 |
"text": datasets.Value("string")
|
| 123 |
}
|
| 124 |
)
|
|
|
|
| 171 |
|
| 172 |
data = json.loads(row)
|
| 173 |
|
| 174 |
+
if "author" in data.keys():
|
| 175 |
+
author = data['author']
|
| 176 |
+
else:
|
| 177 |
+
author = ""
|
| 178 |
+
|
| 179 |
for i in range(0, len(data)):
|
| 180 |
|
| 181 |
current_query = data[i]
|
| 182 |
yield i, {
|
| 183 |
"doc_id": current_query["doc_id"],
|
| 184 |
+
"author": author,
|
| 185 |
"text": current_query["text"]
|
| 186 |
}
|
pooled/dev_collection.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:e651af583a16f146b993af4733eda74dd1a0777636eeb0388f006e50eefdb828
|
| 3 |
+
size 2361574331
|
pooled/test_collection.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:bdb6e16daf375beccbdfd53dfde44f92075336efab349f0d95c21f815e679968
|
| 3 |
+
size 2513579386
|
recreation/dev_collection.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:97010c6392f711981b383aac04812ae99e8e5dfcfc081e5bfb1079e2febc86dc
|
| 3 |
+
size 359239511
|
recreation/test_collection.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:5a34f8fc11db7686513c1aa392e739a0d2257f8827f0218a1c3e17bc12c0a36c
|
| 3 |
+
size 140143137
|
science/dev_collection.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:3e2e304469c6d648b179ac44ab3b9ca9c5ff5a5ffc36fd5e7e6fee822ef38af2
|
| 3 |
+
size 440384983
|
science/test_collection.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:e112805fd1a913e8bc6b92c4bd0e66d94bbf305b9e9bdc9849bb0bac7865b48c
|
| 3 |
+
size 1544428860
|
technology/dev_collection.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:f33ecbe2251ead8b33a9a0449aa6278aace83398077def869b9f6da6ad4ff40e
|
| 3 |
+
size 958027334
|
technology/test_collection.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:756c60bab5e592ebe42987dce49097258a43823be97cc55215210ff5be2120b1
|
| 3 |
+
size 589800516
|
writing/dev_collection.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:7b25776b4ab686ca008fc3629f4f768c8ddc4702f92a3333394589e437c516d9
|
| 3 |
+
size 351804833
|
writing/test_collection.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:e0af85f7136f1b9877c8fd844b21e7e6e5e3eacfb50617b6a4d139a2bcdadc04
|
| 3 |
+
size 154837799
|