lewtun HF staff commited on
Commit
6924232
·
1 Parent(s): 416ae29
Files changed (4) hide show
  1. create_dataset.py +14 -0
  2. test.jsonl +3 -0
  3. train.jsonl +3 -0
  4. unsupervised.jsonl +3 -0
create_dataset.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+
4
+ def main():
5
+ id2label = {0: "negative", 1: "positive", -1: "unlabeled"}
6
+ imdb = load_dataset("imdb")
7
+
8
+ for split, dset in imdb.items():
9
+ dset.map(lambda x: {"label_text": id2label[x["label"]]})
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:94bcc69bf6d448ad330c08dfead52a6db30210d10d33c0532adefa7a2c27c5c9
3
+ size 33095777
train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bcf1456597240670eb98dd16e2cd1293cb8a054f217fe5bffac67291b432fc6
3
+ size 33880437
unsupervised.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6306b20c5e6487539318b75949aae97158fe988f3b4afc4629573559134456b6
3
+ size 68056298