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

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.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,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - zh
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - structure-prediction
18
+ task_ids:
19
+ - named-entity-recognition
20
+ ---
21
+
22
+ # Dataset Card for People's Daily NER
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-instances)
32
+ - [Data Splits](#data-instances)
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
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [Github](https://github.com/OYE93/Chinese-NLP-Corpus/tree/master/NER/People's%20Daily)
50
+ - **Repository:** [Github](https://github.com/OYE93/Chinese-NLP-Corpus/)
51
+ - **Paper:**
52
+ - **Leaderboard:**
53
+ - **Point of Contact:**
54
+
55
+ ### Dataset Summary
56
+
57
+ [More Information Needed]
58
+
59
+ ### Supported Tasks and Leaderboards
60
+
61
+ [More Information Needed]
62
+
63
+ ### Languages
64
+
65
+ [More Information Needed]
66
+
67
+ ## Dataset Structure
68
+
69
+ ### Data Instances
70
+
71
+ [More Information Needed]
72
+
73
+ ### Data Fields
74
+
75
+ [More Information Needed]
76
+
77
+ ### Data Splits
78
+
79
+ [More Information Needed]
80
+
81
+ ## Dataset Creation
82
+
83
+ ### Curation Rationale
84
+
85
+ [More Information Needed]
86
+
87
+ ### Source Data
88
+
89
+ #### Initial Data Collection and Normalization
90
+
91
+ [More Information Needed]
92
+
93
+ #### Who are the source language producers?
94
+
95
+ [More Information Needed]
96
+
97
+ ### Annotations
98
+
99
+ #### Annotation process
100
+
101
+ [More Information Needed]
102
+
103
+ #### Who are the annotators?
104
+
105
+ [More Information Needed]
106
+
107
+ ### Personal and Sensitive Information
108
+
109
+ [More Information Needed]
110
+
111
+ ## Considerations for Using the Data
112
+
113
+ ### Social Impact of Dataset
114
+
115
+ [More Information Needed]
116
+
117
+ ### Discussion of Biases
118
+
119
+ [More Information Needed]
120
+
121
+ ### Other Known Limitations
122
+
123
+ [More Information Needed]
124
+
125
+ ## Additional Information
126
+
127
+ ### Dataset Curators
128
+
129
+ [More Information Needed]
130
+
131
+ ### Licensing Information
132
+
133
+ [More Information Needed]
134
+
135
+ ### Citation Information
136
+
137
+ No citation available for this dataset.
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"peoples_daily_ner": {"description": "People's Daily NER Dataset is a commonly used dataset for Chinese NER, with\ntext from People's Daily (\u4eba\u6c11\u65e5\u62a5), the largest official newspaper.\n\nThe dataset is in BIO scheme. Entity types are: PER (person), ORG (organization)\nand LOC (location).\n", "citation": "", "homepage": "https://github.com/OYE93/Chinese-NLP-Corpus/tree/master/NER/People's%20Daily", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 7, "names": ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "peoples_daily_ner", "config_name": "peoples_daily_ner", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 14972456, "num_examples": 20865, "dataset_name": "peoples_daily_ner"}, "validation": {"name": "validation", "num_bytes": 1676741, "num_examples": 2319, "dataset_name": "peoples_daily_ner"}, "test": {"name": "test", "num_bytes": 3346975, "num_examples": 4637, "dataset_name": "peoples_daily_ner"}}, "download_checksums": {"https://raw.githubusercontent.com/OYE93/Chinese-NLP-Corpus/master/NER/People's%20Daily/example.train": {"num_bytes": 6277429, "checksum": "fbacf4110b131354270b7ff470c88eb84645f0ed8df30c3e409dde437cb45e70"}, "https://raw.githubusercontent.com/OYE93/Chinese-NLP-Corpus/master/NER/People's%20Daily/example.dev": {"num_bytes": 702455, "checksum": "7d8e6fcd1745e6adcb99d90307d84c3a0f9f8ff5ee6fe62ca27646cb765fc38a"}, "https://raw.githubusercontent.com/OYE93/Chinese-NLP-Corpus/master/NER/People's%20Daily/example.test": {"num_bytes": 1405788, "checksum": "233299005f941a4b055e38aadcf3ee853e44bc1f88166078d3b52b26b77ea362"}}, "download_size": 8385672, "post_processing_size": null, "dataset_size": 19996172, "size_in_bytes": 28381844}}
dummy/peoples_daily_ner/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b73839a6419b9283401f0dd8d19a5ce420c4d21b68b70d6a06dc66b1f1ff26c
3
+ size 1134
peoples_daily_ner.py ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 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
+ """Introduction to People's Daily Dataset"""
18
+
19
+ import logging
20
+
21
+ import datasets
22
+
23
+
24
+ _DESCRIPTION = """\
25
+ People's Daily NER Dataset is a commonly used dataset for Chinese NER, with
26
+ text from People's Daily (人民日报), the largest official newspaper.
27
+
28
+ The dataset is in BIO scheme. Entity types are: PER (person), ORG (organization)
29
+ and LOC (location).
30
+ """
31
+
32
+ _URL = "https://raw.githubusercontent.com/OYE93/Chinese-NLP-Corpus/master/NER/People's%20Daily/"
33
+ _TRAINING_FILE = "example.train"
34
+ _DEV_FILE = "example.dev"
35
+ _TEST_FILE = "example.test"
36
+
37
+
38
+ class PeoplesDailyConfig(datasets.BuilderConfig):
39
+ """BuilderConfig for People's Daily NER"""
40
+
41
+ def __init__(self, **kwargs):
42
+ """BuilderConfig for People's Daily NER.
43
+
44
+ Args:
45
+ **kwargs: keyword arguments forwarded to super.
46
+ """
47
+ super(PeoplesDailyConfig, self).__init__(**kwargs)
48
+
49
+
50
+ class PeoplesDailyNer(datasets.GeneratorBasedBuilder):
51
+ """People's Daily NER dataset."""
52
+
53
+ BUILDER_CONFIGS = [
54
+ PeoplesDailyConfig(
55
+ name="peoples_daily_ner", version=datasets.Version("1.0.0"), description="People's Daily NER dataset"
56
+ ),
57
+ ]
58
+
59
+ def _info(self):
60
+ return datasets.DatasetInfo(
61
+ description=_DESCRIPTION,
62
+ features=datasets.Features(
63
+ {
64
+ "id": datasets.Value("string"),
65
+ "tokens": datasets.Sequence(datasets.Value("string")),
66
+ "ner_tags": datasets.Sequence(
67
+ datasets.features.ClassLabel(
68
+ names=[
69
+ "O",
70
+ "B-PER",
71
+ "I-PER",
72
+ "B-ORG",
73
+ "I-ORG",
74
+ "B-LOC",
75
+ "I-LOC",
76
+ ]
77
+ )
78
+ ),
79
+ }
80
+ ),
81
+ supervised_keys=None,
82
+ homepage="https://github.com/OYE93/Chinese-NLP-Corpus/tree/master/NER/People's%20Daily",
83
+ )
84
+
85
+ def _split_generators(self, dl_manager):
86
+ """Returns SplitGenerators."""
87
+ urls_to_download = {
88
+ "train": f"{_URL}{_TRAINING_FILE}",
89
+ "dev": f"{_URL}{_DEV_FILE}",
90
+ "test": f"{_URL}{_TEST_FILE}",
91
+ }
92
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
93
+
94
+ return [
95
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
96
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
97
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
98
+ ]
99
+
100
+ def _generate_examples(self, filepath):
101
+ logging.info("⏳ Generating examples from = %s", filepath)
102
+ with open(filepath, encoding="utf-8") as f:
103
+ guid = 0
104
+ tokens = []
105
+ ner_tags = []
106
+ for line in f:
107
+ line_stripped = line.strip()
108
+ if line_stripped == "":
109
+ if tokens:
110
+ yield guid, {
111
+ "id": str(guid),
112
+ "tokens": tokens,
113
+ "ner_tags": ner_tags,
114
+ }
115
+ guid += 1
116
+ tokens = []
117
+ ner_tags = []
118
+ else:
119
+ splits = line_stripped.split(" ")
120
+ if len(splits) == 1:
121
+ splits.append("O")
122
+ tokens.append(splits[0])
123
+ ner_tags.append(splits[1])
124
+ # last example
125
+ yield guid, {
126
+ "id": str(guid),
127
+ "tokens": tokens,
128
+ "ner_tags": ner_tags,
129
+ }