Add data
Browse files- create_dataset.py +15 -0
- test.jsonl +3 -0
- train.jsonl +3 -0
create_dataset.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
|
4 |
+
def main():
|
5 |
+
id2label = {0: "negative", 1: "positive"}
|
6 |
+
raw_dset = load_dataset("amazon_polarity")
|
7 |
+
|
8 |
+
for split, dset in raw_dset.items():
|
9 |
+
dset = dset.rename_column("content", "text")
|
10 |
+
dset.map(lambda x: {"label_text": id2label[x["label"]]}, num_proc=4)
|
11 |
+
dset.to_json(f"{split}.jsonl")
|
12 |
+
|
13 |
+
|
14 |
+
if __name__ == "__main__":
|
15 |
+
main()
|
test.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:59179105a6e1543e2d8c5155c2d2632a626fd5cc135d1962574bd930a0f74f6f
|
3 |
+
size 185306281
|
train.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9070c58e8fc4196d2aa54ac16fa09eb40b225b759f156b122effee7d1dcfb98
|
3 |
+
size 1668525289
|