Add data
Browse files- create_dataset.py +15 -0
- test.jsonl +3 -0
- train.jsonl +3 -0
- validation.jsonl +3 -0
create_dataset.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
|
4 |
+
def main():
|
5 |
+
raw_dset = load_dataset("go_emotions", "simplified")
|
6 |
+
raw_dset = raw_dset.rename_column("labels", "label")
|
7 |
+
labels = raw_dset["train"].features["label"].feature
|
8 |
+
|
9 |
+
for split, dset in raw_dset.items():
|
10 |
+
dset = dset.map(lambda x: {"label_text": [labels.int2str(l) for l in 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:7cd3e20dd72f27263b5a91c8be5f813ebc18d84f7843deb51801e9b57930bb39
|
3 |
+
size 743871
|
train.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0acc140492c01f3b13d838565d107607068f2b98f33b62372b63796e4cdeb217
|
3 |
+
size 5979423
|
validation.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0fc7a1b582a5fcf707ff088cfc3daf6e085cbc6081000888643f8eb09744f88f
|
3 |
+
size 746703
|