albertvillanova HF staff commited on
Commit
3c8bef3
1 Parent(s): d16d987

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (6f0c473da12c0e552c0cbd8d7e1bb056f9efcf50)
- Delete loading script (c0c13575e32a4ca7350c1d1aab65d4e5f857ba60)

README.md CHANGED
@@ -30,10 +30,15 @@ dataset_info:
30
  '1': positive
31
  splits:
32
  - name: train
33
- num_bytes: 43369710
34
  num_examples: 235165
35
- download_size: 13184332
36
- dataset_size: 43369710
 
 
 
 
 
37
  ---
38
 
39
  # Dataset Card for Turkish Product Reviews
 
30
  '1': positive
31
  splits:
32
  - name: train
33
+ num_bytes: 43369614
34
  num_examples: 235165
35
+ download_size: 24354762
36
+ dataset_size: 43369614
37
+ configs:
38
+ - config_name: default
39
+ data_files:
40
+ - split: train
41
+ path: data/train-*
42
  ---
43
 
44
  # Dataset Card for Turkish Product Reviews
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5ea59cd4f78f03895291c8a7f8be30b78b2f511c71569b68aef3a4f7756ee80
3
+ size 24354762
turkish_product_reviews.py DELETED
@@ -1,60 +0,0 @@
1
- """Turkish Product Reviews"""
2
-
3
-
4
- import os
5
-
6
- import datasets
7
- from datasets.tasks import TextClassification
8
-
9
-
10
- logger = datasets.logging.get_logger(__name__)
11
-
12
-
13
- _CITATION = ""
14
-
15
- _DESCRIPTION = """
16
- Turkish Product Reviews.
17
- This repository contains 235.165 product reviews collected online. There are 220.284 positive, 14881 negative reviews.
18
- """
19
-
20
- _URL = "https://github.com/fthbrmnby/turkish-text-data/raw/master/reviews.tar.gz"
21
- _FILES_PATHS = ["reviews.pos", "reviews.neg"]
22
-
23
- _HOMEPAGE = "https://github.com/fthbrmnby/turkish-text-data"
24
-
25
-
26
- class TurkishProductReviews(datasets.GeneratorBasedBuilder):
27
- VERSION = datasets.Version("1.0.0")
28
-
29
- def _info(self):
30
- return datasets.DatasetInfo(
31
- description=_DESCRIPTION,
32
- features=datasets.Features(
33
- {
34
- "sentence": datasets.Value("string"),
35
- "sentiment": datasets.ClassLabel(names=["negative", "positive"]),
36
- }
37
- ),
38
- citation=_CITATION,
39
- homepage=_HOMEPAGE,
40
- task_templates=[TextClassification(text_column="sentence", label_column="sentiment")],
41
- )
42
-
43
- def _split_generators(self, dl_manager):
44
- """Returns SplitGenerators."""
45
- archive = dl_manager.download(_URL)
46
- return [
47
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"files": dl_manager.iter_archive(archive)}),
48
- ]
49
-
50
- def _generate_examples(self, files):
51
- """Generate TurkishProductReviews examples."""
52
- for file_idx, (path, f) in enumerate(files):
53
- _, file_extension = os.path.splitext(path)
54
- label = "negative" if file_extension == ".neg" else "positive"
55
- for idx, line in enumerate(f):
56
- line = line.decode("utf-8").strip()
57
- yield f"{file_idx}_{idx}", {
58
- "sentence": line,
59
- "sentiment": label,
60
- }