seamew commited on
Commit
124740d
1 Parent(s): 5c9ad34

Update from $USER

Browse files
Hotel.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import csv
2
+
3
+ import datasets
4
+
5
+
6
+ _TRAIN_DOWNLOAD_URL = "https://drive.google.com/u/0/uc?id=1M7bva4QTJWz-z8K1JvZvdyi3EDWXYfXo&export=download"
7
+ _DEV_DOWNLOAD_URL = "https://drive.google.com/u/0/uc?id=13ZGbKuJFXWjHkkPSkKgJoLuklZpuPipE&export=download"
8
+ _TEST_DOWNLOAD_URL = "https://drive.google.com/u/0/uc?id=1YrnAmkHC9Mgnn99azSpmAKRwMxTViIKC&export=download"
9
+
10
+
11
+
12
+ class Hotel(datasets.GeneratorBasedBuilder):
13
+
14
+
15
+ def _info(self):
16
+ return datasets.DatasetInfo(
17
+ description=None,
18
+ features=datasets.Features(
19
+ {
20
+ "text": datasets.Value("string"),
21
+ "label": datasets.features.ClassLabel(names=["negative", "positive"]),
22
+ }
23
+ ),
24
+ homepage=None,
25
+ citation=None,
26
+ )
27
+
28
+ def _split_generators(self, dl_manager):
29
+ train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
30
+ dev_path = dl_manager.download_and_extract(_DEV_DOWNLOAD_URL)
31
+ test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
32
+ return [
33
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
34
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": dev_path}),
35
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
36
+ ]
37
+
38
+ def _generate_examples(self, filepath):
39
+ with open(filepath, encoding="utf-8") as csv_file:
40
+ csv_reader = csv.reader(
41
+ csv_file, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True
42
+ )
43
+ for id_, row in enumerate(csv_reader):
44
+ if id_ == 0:
45
+ continue
46
+ label, text = row
47
+ label = int(label)
48
+ yield id_, {"text": text, "label": label}
dataset_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"description": "", "citation": "", "homepage": "", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["negative", "positive"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hotel", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1994994, "num_examples": 4800, "dataset_name": "hotel"}, "validation": {"name": "validation", "num_bytes": 245717, "num_examples": 600, "dataset_name": "hotel"}, "test": {"name": "test", "num_bytes": 238379, "num_examples": 600, "dataset_name": "hotel"}}, "download_checksums": {"https://drive.google.com/u/0/uc?id=1M7bva4QTJWz-z8K1JvZvdyi3EDWXYfXo&export=download": {"num_bytes": 1959590, "checksum": "35e5a251791f4d4d91c3936e3bb090d134e172448b4ffe46e8297c5effd7dd21"}, "https://drive.google.com/u/0/uc?id=13ZGbKuJFXWjHkkPSkKgJoLuklZpuPipE&export=download": {"num_bytes": 241339, "checksum": "341c5144946e05d0047264e3acc8bf2b3df04483174fbb427f755dbc058b7631"}, "https://drive.google.com/u/0/uc?id=1YrnAmkHC9Mgnn99azSpmAKRwMxTViIKC&export=download": {"num_bytes": 233949, "checksum": "ed49762e11b03564afb27ad238813d1ed218795192a78c8eb9fef15210963bdf"}}, "download_size": 2434878, "post_processing_size": null, "dataset_size": 2479090, "size_in_bytes": 4913968}
hotel-test.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f42dd61736eda6871b1dcfe44535685af6d72656180c1f938beb66324adb63c
3
+ size 239040
hotel-train.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00b6c866285789e350d4e8e623613397f7cc0d3e9ae7e98da2866cde4593e363
3
+ size 1995656
hotel-validation.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bcb3b156ecf1d1c7460d0cdf5bb647e4f687ffdbd6fea57c0e4fa210ba2737e
3
+ size 246384