Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
Korean
Size:
1K<n<10K
License:
Commit
•
920db85
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +160 -0
- dataset_infos.json +1 -0
- dummy/1.1.0/dummy_data.zip +3 -0
- kor_ner.py +174 -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,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- other
|
6 |
+
languages:
|
7 |
+
- ko
|
8 |
+
licenses:
|
9 |
+
- mit
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- structure-prediction
|
18 |
+
task_ids:
|
19 |
+
- named-entity-recognition
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for [Dataset Name]
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** [Github](https://github.com/kmounlp/NER)
|
51 |
+
- **Repository:** [Github](https://github.com/kmounlp/NER)
|
52 |
+
- **Paper:**
|
53 |
+
- **Leaderboard:**
|
54 |
+
- **Point of Contact:**
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
[More Information Needed]
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
[More Information Needed]
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
[More Information Needed]
|
73 |
+
|
74 |
+
### Data Fields
|
75 |
+
|
76 |
+
Each row consists of the following fields:
|
77 |
+
|
78 |
+
- `text`: The full text, as is
|
79 |
+
- `annot_text`: Annotated text including POS-tagged information
|
80 |
+
- `tokens`: An ordered list of tokens from the full text
|
81 |
+
- `pos_tags`: Part-of-speech tags for each token
|
82 |
+
- `ner_tags`: Named entity recognition tags for each token
|
83 |
+
|
84 |
+
Note that by design, the length of `tokens`, `pos_tags`, and `ner_tags` will always be identical.
|
85 |
+
|
86 |
+
`pos_tags` corresponds to the list below:
|
87 |
+
|
88 |
+
```
|
89 |
+
['SO', 'SS', 'VV', 'XR', 'VCP', 'JC', 'VCN', 'JKB', 'MM', 'SP', 'XSN', 'SL', 'NNP', 'NP', 'EP', 'JKQ', 'IC', 'XSA', 'EC', 'EF', 'SE', 'XPN', 'ETN', 'SH', 'XSV', 'MAG', 'SW', 'ETM', 'JKO', 'NNB', 'MAJ', 'NNG', 'JKV', 'JKC', 'VA', 'NR', 'JKG', 'VX', 'SF', 'JX', 'JKS', 'SN']
|
90 |
+
```
|
91 |
+
|
92 |
+
`ner_tags` correspond to the following:
|
93 |
+
|
94 |
+
```
|
95 |
+
["I", "O", "B_OG", "B_TI", "B_LC", "B_DT", "B_PS"]
|
96 |
+
```
|
97 |
+
|
98 |
+
The prefix `B` denotes the first item of a phrase, and an `I` denotes any non-initial word. In addition, `OG` represens an organization; `TI`, time; `DT`, date, and `PS`, person.
|
99 |
+
|
100 |
+
### Data Splits
|
101 |
+
|
102 |
+
[More Information Needed]
|
103 |
+
|
104 |
+
## Dataset Creation
|
105 |
+
|
106 |
+
### Curation Rationale
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
### Source Data
|
111 |
+
|
112 |
+
#### Initial Data Collection and Normalization
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the source language producers?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Annotations
|
121 |
+
|
122 |
+
#### Annotation process
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
#### Who are the annotators?
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Personal and Sensitive Information
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
## Considerations for Using the Data
|
135 |
+
|
136 |
+
### Social Impact of Dataset
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Discussion of Biases
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Other Known Limitations
|
145 |
+
|
146 |
+
[More Information Needed]
|
147 |
+
|
148 |
+
## Additional Information
|
149 |
+
|
150 |
+
### Dataset Curators
|
151 |
+
|
152 |
+
[More Information Needed]
|
153 |
+
|
154 |
+
### Licensing Information
|
155 |
+
|
156 |
+
[More Information Needed]
|
157 |
+
|
158 |
+
### Citation Information
|
159 |
+
|
160 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "Korean named entity recognition dataset\n", "citation": "@InProceedings{Kim:2016,\n title = \"Korean Named Entity Recognition Dataset\",\n authors = \"Jae-Hoon Kim\",\n publisher = \"GitHub\",\n year = \"2016\"\n}\n", "homepage": "https://github.com/kmounlp/NER", "license": "NER License, MIT License for non-commercial use", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "annot_text": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"num_classes": 42, "names": ["SO", "SS", "VV", "XR", "VCP", "JC", "VCN", "JKB", "MM", "SP", "XSN", "SL", "NNP", "NP", "EP", "JKQ", "IC", "XSA", "EC", "EF", "SE", "XPN", "ETN", "SH", "XSV", "MAG", "SW", "ETM", "JKO", "NNB", "MAJ", "NNG", "JKV", "JKC", "VA", "NR", "JKG", "VX", "SF", "JX", "JKS", "SN"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 7, "names": ["I", "O", "B_OG", "B_TI", "B_LC", "B_DT", "B_PS"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "kor_ner", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3948938, "num_examples": 2928, "dataset_name": "kor_ner"}, "test": {"name": "test", "num_bytes": 476850, "num_examples": 366, "dataset_name": "kor_ner"}, "validation": {"name": "validation", "num_bytes": 486178, "num_examples": 366, "dataset_name": "kor_ner"}}, "download_checksums": {"https://raw.githubusercontent.com/kmounlp/NER/master/2016klp/ner.train": {"num_bytes": 2808804, "checksum": "ae8d0b9ecc49a36ec8fd30ebed5accf2e4da23e8e432d0e4e494be049412c1cf"}, "https://raw.githubusercontent.com/kmounlp/NER/master/2016klp/ner.test": {"num_bytes": 338858, "checksum": "35396b5d88d9c3feb74a5e43097482e4379ff522bc66ed0d2a1e40a4e34a5645"}, "https://raw.githubusercontent.com/kmounlp/NER/master/2016klp/ner.dev": {"num_bytes": 345513, "checksum": "0b6afc8e02a5bb3439b697da7aa6bc274b1128f84c14f6bde85c7d0934b145d6"}}, "download_size": 3493175, "post_processing_size": null, "dataset_size": 4911966, "size_in_bytes": 8405141}}
|
dummy/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5b0703c3de2f56a96b7c0f6af11758194df0756648c126390918a2e71f77462e
|
3 |
+
size 3357
|
kor_ner.py
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
+
"""Korean named entity recognition dataset"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import logging
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@InProceedings{Kim:2016,
|
26 |
+
title = "Korean Named Entity Recognition Dataset",
|
27 |
+
authors = "Jae-Hoon Kim",
|
28 |
+
publisher = "GitHub",
|
29 |
+
year = "2016"
|
30 |
+
}
|
31 |
+
"""
|
32 |
+
|
33 |
+
|
34 |
+
_DESCRIPTION = """\
|
35 |
+
Korean named entity recognition dataset
|
36 |
+
"""
|
37 |
+
|
38 |
+
_HOMEPAGE = "https://github.com/kmounlp/NER"
|
39 |
+
|
40 |
+
_LICENSE = "NER License, MIT License for non-commercial use"
|
41 |
+
|
42 |
+
_URL = "https://raw.githubusercontent.com/kmounlp/NER/master/2016klp/ner."
|
43 |
+
_URLs = {key: _URL + key for key in ("train", "test", "dev")}
|
44 |
+
|
45 |
+
|
46 |
+
class KorNER(datasets.GeneratorBasedBuilder):
|
47 |
+
"""Korean Named entity recognition dataset"""
|
48 |
+
|
49 |
+
VERSION = datasets.Version("1.1.0")
|
50 |
+
|
51 |
+
def _info(self):
|
52 |
+
return datasets.DatasetInfo(
|
53 |
+
description=_DESCRIPTION,
|
54 |
+
features=datasets.Features(
|
55 |
+
{
|
56 |
+
"text": datasets.Value("string"),
|
57 |
+
"annot_text": datasets.Value("string"),
|
58 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
59 |
+
"pos_tags": datasets.Sequence(
|
60 |
+
datasets.features.ClassLabel(
|
61 |
+
names=[
|
62 |
+
"SO",
|
63 |
+
"SS",
|
64 |
+
"VV",
|
65 |
+
"XR",
|
66 |
+
"VCP",
|
67 |
+
"JC",
|
68 |
+
"VCN",
|
69 |
+
"JKB",
|
70 |
+
"MM",
|
71 |
+
"SP",
|
72 |
+
"XSN",
|
73 |
+
"SL",
|
74 |
+
"NNP",
|
75 |
+
"NP",
|
76 |
+
"EP",
|
77 |
+
"JKQ",
|
78 |
+
"IC",
|
79 |
+
"XSA",
|
80 |
+
"EC",
|
81 |
+
"EF",
|
82 |
+
"SE",
|
83 |
+
"XPN",
|
84 |
+
"ETN",
|
85 |
+
"SH",
|
86 |
+
"XSV",
|
87 |
+
"MAG",
|
88 |
+
"SW",
|
89 |
+
"ETM",
|
90 |
+
"JKO",
|
91 |
+
"NNB",
|
92 |
+
"MAJ",
|
93 |
+
"NNG",
|
94 |
+
"JKV",
|
95 |
+
"JKC",
|
96 |
+
"VA",
|
97 |
+
"NR",
|
98 |
+
"JKG",
|
99 |
+
"VX",
|
100 |
+
"SF",
|
101 |
+
"JX",
|
102 |
+
"JKS",
|
103 |
+
"SN",
|
104 |
+
]
|
105 |
+
)
|
106 |
+
),
|
107 |
+
"ner_tags": datasets.Sequence(
|
108 |
+
datasets.features.ClassLabel(names=["I", "O", "B_OG", "B_TI", "B_LC", "B_DT", "B_PS"])
|
109 |
+
),
|
110 |
+
}
|
111 |
+
),
|
112 |
+
supervised_keys=None,
|
113 |
+
homepage=_HOMEPAGE,
|
114 |
+
license=_LICENSE,
|
115 |
+
citation=_CITATION,
|
116 |
+
)
|
117 |
+
|
118 |
+
def _split_generators(self, dl_manager):
|
119 |
+
downloaded_files = dl_manager.download_and_extract(_URLs)
|
120 |
+
return [
|
121 |
+
datasets.SplitGenerator(
|
122 |
+
name=datasets.Split.TRAIN,
|
123 |
+
gen_kwargs={
|
124 |
+
"filepath": downloaded_files["train"],
|
125 |
+
"split": "train",
|
126 |
+
},
|
127 |
+
),
|
128 |
+
datasets.SplitGenerator(
|
129 |
+
name=datasets.Split.TEST,
|
130 |
+
gen_kwargs={
|
131 |
+
"filepath": downloaded_files["test"],
|
132 |
+
"split": "test",
|
133 |
+
},
|
134 |
+
),
|
135 |
+
datasets.SplitGenerator(
|
136 |
+
name=datasets.Split.VALIDATION,
|
137 |
+
gen_kwargs={
|
138 |
+
"filepath": downloaded_files["dev"],
|
139 |
+
"split": "validation",
|
140 |
+
},
|
141 |
+
),
|
142 |
+
]
|
143 |
+
|
144 |
+
def _generate_examples(self, filepath, split):
|
145 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
146 |
+
with open(filepath, encoding="utf-8") as f:
|
147 |
+
text = ""
|
148 |
+
annot_text = ""
|
149 |
+
tokens = []
|
150 |
+
pos_tags = []
|
151 |
+
ner_tags = []
|
152 |
+
for id_, row in enumerate(f):
|
153 |
+
row = row.strip()
|
154 |
+
if not row:
|
155 |
+
yield id_, {
|
156 |
+
"text": text,
|
157 |
+
"annot_text": annot_text,
|
158 |
+
"tokens": tokens,
|
159 |
+
"pos_tags": pos_tags,
|
160 |
+
"ner_tags": ner_tags,
|
161 |
+
}
|
162 |
+
tokens.clear()
|
163 |
+
pos_tags.clear()
|
164 |
+
ner_tags.clear()
|
165 |
+
continue
|
166 |
+
if row[0] == ";":
|
167 |
+
text = row[2:]
|
168 |
+
elif row[0] == "$":
|
169 |
+
annot_text = row[1:]
|
170 |
+
else:
|
171 |
+
_, token, pos_tag, ner_tag = row.split("\t")
|
172 |
+
tokens.append(token)
|
173 |
+
pos_tags.append(pos_tag)
|
174 |
+
ner_tags.append(ner_tag)
|