Add data
Browse files- create_dataset.py +14 -0
- test.jsonl +3 -0
- train.jsonl +3 -0
create_dataset.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
|
4 |
+
def main():
|
5 |
+
raw_dset = load_dataset("amazon_polarity")
|
6 |
+
labels = raw_dset["train"].features["label"]
|
7 |
+
|
8 |
+
for split, dset in raw_dset.items():
|
9 |
+
dset = dset.map(lambda x: {"label_text": labels.int2str(x["label"])}, num_proc=4)
|
10 |
+
dset.to_json(f"{split}.jsonl")
|
11 |
+
|
12 |
+
|
13 |
+
if __name__ == "__main__":
|
14 |
+
main()
|
test.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:26fc89cf0cd74afe7bceaf5900761ac8122532f26a35518146fd32eb23ffc797
|
3 |
+
size 196106281
|
train.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed0e122ad1827b7336e393f01fac548151c280201d5e39dd8de76f8aec54eec0
|
3 |
+
size 1765725289
|