system HF staff commited on
Commit
0e0f0a6
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
allocine.py ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Allocine Dataset: A Large-Scale French Movie Reviews Dataset."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import json
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ _CITATION = """\
12
+ @misc{blard2019allocine,
13
+ author = {Blard, Theophile},
14
+ title = {french-sentiment-analysis-with-bert},
15
+ year = {2020},
16
+ publisher = {GitHub},
17
+ journal = {GitHub repository},
18
+ howpublished={\\url{https://github.com/TheophileBlard/french-sentiment-analysis-with-bert}},
19
+ }
20
+ """
21
+
22
+ _DESCRIPTION = """\
23
+ Allocine Dataset: A Large-Scale French Movie Reviews Dataset.
24
+ This is a dataset for binary sentiment classification, made of user reviews scraped from Allocine.fr.
25
+ It contains 100k positive and 100k negative reviews divided into 3 balanced splits: train (160k reviews), val (20k) and test (20k).
26
+ """
27
+
28
+
29
+ class AllocineConfig(datasets.BuilderConfig):
30
+ """BuilderConfig for Allocine."""
31
+
32
+ def __init__(self, **kwargs):
33
+ """BuilderConfig for Allocine.
34
+
35
+ Args:
36
+ **kwargs: keyword arguments forwarded to super.
37
+ """
38
+ super(AllocineConfig, self).__init__(**kwargs)
39
+
40
+
41
+ class AllocineDataset(datasets.GeneratorBasedBuilder):
42
+ """Allocine Dataset: A Large-Scale French Movie Reviews Dataset."""
43
+
44
+ _DOWNLOAD_URL = "https://github.com/TheophileBlard/french-sentiment-analysis-with-bert/raw/master/allocine_dataset/data.tar.bz2"
45
+ _TRAIN_FILE = "train.jsonl"
46
+ _VAL_FILE = "val.jsonl"
47
+ _TEST_FILE = "test.jsonl"
48
+
49
+ BUILDER_CONFIGS = [
50
+ AllocineConfig(
51
+ name="allocine",
52
+ version=datasets.Version("1.0.0"),
53
+ description="Allocine Dataset: A Large-Scale French Movie Reviews Dataset",
54
+ ),
55
+ ]
56
+
57
+ def _info(self):
58
+ return datasets.DatasetInfo(
59
+ description=_DESCRIPTION,
60
+ features=datasets.Features(
61
+ {
62
+ "review": datasets.Value("string"),
63
+ "label": datasets.features.ClassLabel(names=["neg", "pos"]),
64
+ }
65
+ ),
66
+ supervised_keys=None,
67
+ homepage="https://github.com/TheophileBlard/french-sentiment-analysis-with-bert",
68
+ citation=_CITATION,
69
+ )
70
+
71
+ def _split_generators(self, dl_manager):
72
+ arch_path = dl_manager.download_and_extract(self._DOWNLOAD_URL)
73
+ data_dir = os.path.join(arch_path, "data")
74
+ return [
75
+ datasets.SplitGenerator(
76
+ name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir, self._TRAIN_FILE)}
77
+ ),
78
+ datasets.SplitGenerator(
79
+ name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, self._VAL_FILE)}
80
+ ),
81
+ datasets.SplitGenerator(
82
+ name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, self._TEST_FILE)}
83
+ ),
84
+ ]
85
+
86
+ def _generate_examples(self, filepath):
87
+ """Generate Allocine examples."""
88
+ with open(filepath, encoding="utf-8") as f:
89
+ for id_, row in enumerate(f):
90
+ data = json.loads(row)
91
+ review = data["review"]
92
+ label = "neg" if data["polarity"] == 0 else "pos"
93
+ yield id_, {"review": review, "label": label}
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"allocine": {"description": " Allocine Dataset: A Large-Scale French Movie Reviews Dataset.\n This is a dataset for binary sentiment classification, made of user reviews scraped from Allocine.fr.\n It contains 100k positive and 100k negative reviews divided into 3 balanced splits: train (160k reviews), val (20k) and test (20k).\n", "citation": "@misc{blard2019allocine,\n author = {Blard, Theophile},\n title = {french-sentiment-analysis-with-bert},\n year = {2020},\n publisher = {GitHub},\n journal = {GitHub repository},\n howpublished={\\url{https://github.com/TheophileBlard/french-sentiment-analysis-with-bert}},\n}\n", "homepage": "https://github.com/TheophileBlard/french-sentiment-analysis-with-bert", "license": "", "features": {"review": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["neg", "pos"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "supervised_keys": null, "builder_name": "allocine_dataset", "config_name": "allocine", "version": {"version_str": "1.0.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 91330696, "num_examples": 160000, "dataset_name": "allocine_dataset"}, "validation": {"name": "validation", "num_bytes": 11546250, "num_examples": 20000, "dataset_name": "allocine_dataset"}, "test": {"name": "test", "num_bytes": 11547697, "num_examples": 20000, "dataset_name": "allocine_dataset"}}, "download_checksums": {"https://github.com/TheophileBlard/french-sentiment-analysis-with-bert/raw/master/allocine_dataset/data.tar.bz2": {"num_bytes": 66625305, "checksum": "8c49a8cac783da201697ed1a91b36d2f6618222b3b7ea1c2996f2a3fbc37dfb4"}}, "download_size": 66625305, "dataset_size": 114424643, "size_in_bytes": 181049948}}
dummy/allocine/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8b8bdcd183e1205a888435a5f51da74db9b7580363f155d1ad87272f1040516
3
+ size 4367