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

Update files from the datasets library (from 1.3.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.3.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
README.md ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 100K<n<1M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - sequence-modeling
18
+ task_ids:
19
+ - language-modeling
20
+ ---
21
+
22
+ # Dataset Card for CC-News
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-fields)
32
+ - [Data Splits](#data-splits)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+ - [Contributions](#contributions)
47
+
48
+ ## Dataset Description
49
+
50
+ - **Homepage:** [CC-News homepage](https://commoncrawl.org/2016/10/news-dataset-available/)
51
+ - **Point of Contact:** [Vladimir Blagojevic](mailto:dovlex@gmail.com)
52
+
53
+ ### Dataset Summary
54
+
55
+ CC-News dataset contains news articles from news sites all over the world. The data is available on AWS S3 in the Common Crawl bucket at /crawl-data/CC-NEWS/.
56
+ This version of the dataset has been prepared using [news-please](https://github.com/fhamborg/news-please) - an integrated web crawler and information extractor for news.
57
+ It contains 708241 English language news articles published between Jan 2017 and December 2019.
58
+ It represents a small portion of the English language subset of the CC-News dataset.
59
+
60
+ ### Supported Tasks and Leaderboards
61
+
62
+ [N/A]
63
+
64
+ ### Languages
65
+
66
+ The text in the dataset is in the English language.
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+
72
+ Dataset instance contains an article itself and the relevant article fields.
73
+ An example from the Cc-New train set looks as follows:
74
+ ```
75
+ {
76
+ 'date': '2017-08-14 00:00:00',
77
+ 'description': '"The spirit of Green Day has always been about rising above oppression."',
78
+ 'domain': '1041jackfm.cbslocal.com',
79
+ 'image_url': 'https://cbs1041jackfm.files.wordpress.com/2017/08/billie-joe-armstrong-theo-wargo-getty-images.jpg?w=946',
80
+ 'text': 'By Abby Hassler\nGreen Day’s Billie Joe Armstrong has always been outspoken about his political beliefs. Following
81
+ the tragedy in Charlottesville, Virgina, over the weekend, Armstrong felt the need to speak out against the white supremacists
82
+ who caused much of the violence.\nRelated: Billie Joe Armstrong Wins #TBT with Childhood Studio Photo\n“My heart feels heavy.
83
+ I feel like what happened in Charlottesville goes beyond the point of anger,” Armstrong wrote on Facebook. “It makes me sad
84
+ and desperate. shocked. I f—— hate racism more than anything.”\n“The spirit of Green Day has always been about rising above
85
+ oppression. and sticking up for what you believe in and singing it at the top of your lungs,” Armstrong continued.
86
+ “We grew up fearing nuclear holocaust because of the cold war. those days are feeling way too relevant these days.
87
+ these issues are our ugly past.. and now it’s coming to haunt us. always resist these doomsday politicians. and in the
88
+ words of our punk forefathers .. Nazi punks f— off.”',
89
+ 'title': 'Green Day’s Billie Joe Armstrong Rails Against White Nationalists',
90
+ 'url': 'http://1041jackfm.cbslocal.com/2017/08/14/billie-joe-armstrong-white-nationalists/'
91
+ }
92
+ ```
93
+
94
+ ### Data Fields
95
+
96
+ - `date`: date of publication
97
+ - `description`: description or a summary of the article
98
+ - `domain`: source domain of the article (i.e. www.nytimes.com)
99
+ - `image_url`: URL of the article's image
100
+ - `text`: the actual article text in raw form
101
+ - `title`: title of the article
102
+ - `url`: article URL, the original URL where it was scraped.
103
+
104
+
105
+ ### Data Splits
106
+
107
+ CC-News dataset has only the training set, i.e. it has to be loaded with `train` split specified:
108
+ `cc_news = load_dataset('cc_news', split="train")`
109
+
110
+ ## Dataset Creation
111
+
112
+ CC-News has been mostly used for language model training.
113
+
114
+ ### Source Data
115
+
116
+ #### Initial Data Collection and Normalization
117
+
118
+ CC-News dataset has been proposed, created, and maintained by Sebastian Nagel.
119
+ The data is publicly available on AWS S3 Common Crawl bucket at /crawl-data/CC-NEWS/.
120
+ This version of the dataset has been prepared using [news-please](https://github.com/fhamborg/news-please) - an
121
+ integrated web crawler and information extractor for news.
122
+ It contains 708241 English language news articles published between Jan 2017 and December 2019.
123
+ Although news-please tags each news article with an appropriate language tag, these tags are somewhat unreliable.
124
+ To strictly isolate English language articles an additional check has been performed using
125
+ [Spacy langdetect pipeline](https://spacy.io/universe/project/spacy-langdetect).
126
+ We selected articles with text fields scores of 80% probability or more of being English.
127
+ There are no strict guarantees that each article has all the relevant fields. For example, 527595
128
+ articles have a valid description field. All articles have what appears to be a valid image URL,
129
+ but they have not been verified.
130
+
131
+ #### Who are the source language producers?
132
+
133
+ The news websites throughout the World.
134
+
135
+ ### Annotations
136
+
137
+ #### Annotation process
138
+
139
+ [N/A]
140
+
141
+ #### Who are the annotators?
142
+
143
+ [N/A]
144
+
145
+ ### Personal and Sensitive Information
146
+
147
+ As one can imagine, data contains contemporary public figures or individuals who appeared in the news.
148
+
149
+ ## Considerations for Using the Data
150
+
151
+ ### Social Impact of Dataset
152
+
153
+ The purpose of this dataset is to help language model researchers develop better language models.
154
+
155
+ ### Discussion of Biases
156
+
157
+ [More Information Needed]
158
+
159
+ ### Other Known Limitations
160
+
161
+ [More Information Needed]
162
+
163
+ ## Additional Information
164
+
165
+ ### Dataset Curators
166
+
167
+ [More Information Needed]
168
+
169
+ ### Licensing Information
170
+
171
+ [More Information Needed]
172
+
173
+ ### Citation Information
174
+
175
+ [More Information Needed]
cc_news.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+ """The CC-News dataset is based on Common Crawl News Dataset by Sebastian Nagel"""
18
+ from __future__ import absolute_import, division, print_function
19
+
20
+ import glob
21
+ import json
22
+ import logging
23
+ import os
24
+
25
+ import datasets
26
+
27
+
28
+ _DESCRIPTION = """\
29
+ CC-News containing news articles from news sites all over the world \
30
+ The data is available on AWS S3 in the Common Crawl bucket at /crawl-data/CC-NEWS/. \
31
+ This version of the dataset has 708241 articles. It represents a small portion of English \
32
+ language subset of the CC-News dataset created using news-please(Hamborg et al.,2017) to \
33
+ collect and extract English language portion of CC-News.
34
+ """
35
+
36
+ _CITATION = """\
37
+ @InProceedings{Hamborg2017,
38
+ author = {Hamborg, Felix and Meuschke, Norman and Breitinger, Corinna and Gipp, Bela},
39
+ title = {news-please: A Generic News Crawler and Extractor},
40
+ year = {2017},
41
+ booktitle = {Proceedings of the 15th International Symposium of Information Science},
42
+ location = {Berlin},
43
+ doi = {10.5281/zenodo.4120316},
44
+ pages = {218--223},
45
+ month = {March}
46
+ }
47
+ """
48
+ _PROJECT_URL = "https://commoncrawl.org/2016/10/news-dataset-available/"
49
+ _DOWNLOAD_URL = "https://storage.googleapis.com/huggingface-nlp/datasets/cc_news/cc_news.tar.gz"
50
+
51
+
52
+ class CCNewsConfig(datasets.BuilderConfig):
53
+ """BuilderConfig for CCNews."""
54
+
55
+ def __init__(self, **kwargs):
56
+ """BuilderConfig for CCNews.
57
+ Args:
58
+ **kwargs: keyword arguments forwarded to super.
59
+ """
60
+ super(CCNewsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
61
+
62
+
63
+ class CCNews(datasets.GeneratorBasedBuilder):
64
+ """CC-News dataset."""
65
+
66
+ BUILDER_CONFIGS = [
67
+ CCNewsConfig(
68
+ name="plain_text",
69
+ description="Plain text",
70
+ )
71
+ ]
72
+
73
+ def _info(self):
74
+ return datasets.DatasetInfo(
75
+ description=_DESCRIPTION,
76
+ features=datasets.Features(
77
+ {
78
+ "title": datasets.Value("string"),
79
+ "text": datasets.Value("string"),
80
+ "domain": datasets.Value("string"),
81
+ "date": datasets.Value("string"),
82
+ "description": datasets.Value("string"),
83
+ "url": datasets.Value("string"),
84
+ "image_url": datasets.Value("string"),
85
+ }
86
+ ),
87
+ supervised_keys=None,
88
+ homepage=_PROJECT_URL,
89
+ citation=_CITATION,
90
+ )
91
+
92
+ def _split_generators(self, dl_manager):
93
+ arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL)
94
+
95
+ return [
96
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"directory": arch_path}),
97
+ ]
98
+
99
+ def _generate_examples(self, directory):
100
+ logging.info("CC-News dataset: generating examples from = %s", directory)
101
+ glob_target = os.path.join(directory, "**/*.json")
102
+ article_files = glob.glob(glob_target, recursive=True)
103
+ article_files = sorted(article_files)
104
+ id_ = 0
105
+ for article_file_path in article_files:
106
+ with open(article_file_path, mode="r", encoding="utf-8") as f:
107
+ article = json.load(f)
108
+ yield id_, {
109
+ "title": article["title"].strip() if article["title"] is not None else "",
110
+ "text": article["maintext"].strip() if article["maintext"] is not None else "",
111
+ "domain": article["source_domain"].strip() if article["source_domain"] is not None else "",
112
+ "date": article["date_publish"].strip() if article["date_publish"] is not None else "",
113
+ "description": article["description"].strip() if article["description"] is not None else "",
114
+ "url": article["url"].strip() if article["url"] is not None else "",
115
+ "image_url": article["image_url"].strip() if article["image_url"] is not None else "",
116
+ }
117
+ id_ += 1
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"plain_text": {"description": "CC-News containing news articles from news sites all over the world The data is available on AWS S3 in the Common Crawl bucket at /crawl-data/CC-NEWS/. This version of the dataset has 708241 articles. It represents a small portion of English language subset of the CC-News dataset created using news-please(Hamborg et al.,2017) to collect and extract English language portion of CC-News.\n", "citation": "@InProceedings{Hamborg2017,\n author = {Hamborg, Felix and Meuschke, Norman and Breitinger, Corinna and Gipp, Bela},\n title = {news-please: A Generic News Crawler and Extractor},\n year = {2017},\n booktitle = {Proceedings of the 15th International Symposium of Information Science},\n location = {Berlin},\n doi = {10.5281/zenodo.4120316},\n pages = {218--223},\n month = {March}\n}\n", "homepage": "https://commoncrawl.org/2016/10/news-dataset-available/", "license": "", "features": {"title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "domain": {"dtype": "string", "id": null, "_type": "Value"}, "date": {"dtype": "string", "id": null, "_type": "Value"}, "description": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "image_url": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "cc_news", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2016418133, "num_examples": 708241, "dataset_name": "cc_news"}}, "download_checksums": {"https://storage.googleapis.com/huggingface-nlp/datasets/cc_news/cc_news.tar.gz": {"num_bytes": 845131146, "checksum": "1aaf8e5af33e3a73472b58afba48c6a839ebc2dd190c4e0754fc00f8899a9cec"}}, "download_size": 845131146, "post_processing_size": null, "dataset_size": 2016418133, "size_in_bytes": 2861549279}}
dummy/plain_text/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32836c4685e55d393387cc2786037cf6fea916512f9d3f0c07cb39454390996d
3
+ size 4747