luketheduke
commited on
Commit
·
6028d44
1
Parent(s):
5d211ec
Upload create_dataset.py
Browse files- create_dataset.py +17 -0
create_dataset.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
|
4 |
+
def main():
|
5 |
+
raw_dset = load_dataset("glue", "stsb")
|
6 |
+
raw_dset = raw_dset.rename_column("sentence1", "text1")
|
7 |
+
raw_dset = raw_dset.rename_column("sentence2", "text2")
|
8 |
+
|
9 |
+
for split, dset in raw_dset.items():
|
10 |
+
label_text = ["NA"] * len(dset)
|
11 |
+
dset = dset.add_column("label_text", label_text)
|
12 |
+
dset.to_json(f"{split}.jsonl")
|
13 |
+
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
main()
|
17 |
+
print("Job's done!")
|