Datasets:
Tasks:
Question Answering
Sub-tasks:
extractive-qa
Languages:
English
Size:
1M<n<10M
ArXiv:
License:
import pandas as pd | |
import os | |
from tqdm import tqdm | |
import json | |
directories = ['lifestyle', 'pooled', 'recreation', 'science', 'technology', 'writing'] #os.listdir() | |
for directory in directories: | |
for file_type in ["dev", "test"]: | |
current_jsonl = [] | |
loaded_file = pd.read_csv('data/' + directory + "/" + file_type + "/collection.tsv", sep='\t', header=0) | |
for row in tqdm(range(0, len(loaded_file))): | |
current_jsonl.append({ | |
"doc_id": row, | |
"text": loaded_file.iloc[row][1] | |
}) | |
if not os.path.isdir(directory): | |
os.mkdir(directory) | |
with open(directory + "/" + file_type + "_collection.jsonl", 'w', encoding="utf-8") as fout: | |
json.dump(current_jsonl, fout) |