Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
Swati
Size:
10K<n<100K
License:
Commit
•
562ad9d
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 +171 -0
- dataset_infos.json +1 -0
- dummy/siswati_ner_corpus/1.0.0/dummy_data.zip +3 -0
- siswati_ner_corpus.py +144 -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,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- ss
|
8 |
+
licenses:
|
9 |
+
- other-Creative Commons Attribution 2-5 South Africa License
|
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 Siswati NER Corpus
|
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:** [Siswati Ner Corpus Homepage](https://repo.sadilar.org/handle/20.500.12185/346)
|
50 |
+
- **Repository:**
|
51 |
+
- **Paper:**
|
52 |
+
- **Leaderboard:**
|
53 |
+
- **Point of Contact:** [Martin Puttkammer](mailto:Martin.Puttkammer@nwu.ac.za)
|
54 |
+
|
55 |
+
### Dataset Summary
|
56 |
+
|
57 |
+
The Siswati Ner Corpus is a Siswati dataset developed by [The Centre for Text Technology (CTexT), North-West University, South Africa](http://humanities.nwu.ac.za/ctext). The data is based on documents from the South African goverment domain and crawled from gov.za websites. It was created to support NER task for Siswati language. The dataset uses CoNLL shared task annotation standards.
|
58 |
+
|
59 |
+
### Supported Tasks and Leaderboards
|
60 |
+
|
61 |
+
[More Information Needed]
|
62 |
+
|
63 |
+
### Languages
|
64 |
+
|
65 |
+
The language supported is Siswati.
|
66 |
+
|
67 |
+
## Dataset Structure
|
68 |
+
|
69 |
+
### Data Instances
|
70 |
+
|
71 |
+
A data point consists of sentences seperated by empty line and tab-seperated tokens and tags.
|
72 |
+
```
|
73 |
+
{'id': '0',
|
74 |
+
'ner_tags': [0, 0, 0, 0, 0],
|
75 |
+
'tokens': ['Tinsita', 'tebantfu', ':', 'tinsita', 'tetakhamiti']
|
76 |
+
}
|
77 |
+
```
|
78 |
+
|
79 |
+
### Data Fields
|
80 |
+
|
81 |
+
- `id`: id of the sample
|
82 |
+
- `tokens`: the tokens of the example text
|
83 |
+
- `ner_tags`: the NER tags of each token
|
84 |
+
|
85 |
+
The NER tags correspond to this list:
|
86 |
+
```
|
87 |
+
"OUT", "B-PERS", "I-PERS", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC",
|
88 |
+
```
|
89 |
+
The NER tags have the same format as in the CoNLL shared task: a B denotes the first item of a phrase and an I any non-initial word. There are four types of phrases: person names (PER), organizations (ORG), locations (LOC) and miscellaneous names (MISC). (OUT) is used for tokens not considered part of any named entity.
|
90 |
+
|
91 |
+
### Data Splits
|
92 |
+
|
93 |
+
The data was not split.
|
94 |
+
|
95 |
+
## Dataset Creation
|
96 |
+
|
97 |
+
### Curation Rationale
|
98 |
+
|
99 |
+
The data was created to help introduce resources to new language - siswati.
|
100 |
+
|
101 |
+
[More Information Needed]
|
102 |
+
|
103 |
+
### Source Data
|
104 |
+
|
105 |
+
#### Initial Data Collection and Normalization
|
106 |
+
|
107 |
+
The data is based on South African government domain and was crawled from gov.za websites.
|
108 |
+
|
109 |
+
#### Who are the source language producers?
|
110 |
+
|
111 |
+
The data was produced by writers of South African government websites - gov.za
|
112 |
+
|
113 |
+
[More Information Needed]
|
114 |
+
|
115 |
+
### Annotations
|
116 |
+
|
117 |
+
#### Annotation process
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
#### Who are the annotators?
|
122 |
+
|
123 |
+
The data was annotated during the NCHLT text resource development project.
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Personal and Sensitive Information
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
## Considerations for Using the Data
|
132 |
+
|
133 |
+
### Social Impact of Dataset
|
134 |
+
|
135 |
+
[More Information Needed]
|
136 |
+
|
137 |
+
### Discussion of Biases
|
138 |
+
|
139 |
+
[More Information Needed]
|
140 |
+
|
141 |
+
### Other Known Limitations
|
142 |
+
|
143 |
+
[More Information Needed]
|
144 |
+
|
145 |
+
## Additional Information
|
146 |
+
|
147 |
+
### Dataset Curators
|
148 |
+
|
149 |
+
The annotated data sets were developed by the Centre for Text Technology (CTexT, North-West University, South Africa).
|
150 |
+
|
151 |
+
See: [more information](http://www.nwu.ac.za/ctext)
|
152 |
+
|
153 |
+
### Licensing Information
|
154 |
+
|
155 |
+
The data is under the [Creative Commons Attribution 2.5 South Africa License](http://creativecommons.org/licenses/by/2.5/za/legalcode)
|
156 |
+
|
157 |
+
### Citation Information
|
158 |
+
|
159 |
+
```
|
160 |
+
@inproceedings{siswati_ner_corpus,
|
161 |
+
author = {B.B. Malangwane and
|
162 |
+
M.N. Kekana and
|
163 |
+
S.S. Sedibe and
|
164 |
+
B.C. Ndhlovu and
|
165 |
+
Roald Eiselen},
|
166 |
+
title = {NCHLT Siswati Named Entity Annotated Corpus},
|
167 |
+
booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portorož, Slovenia.},
|
168 |
+
year = {2016},
|
169 |
+
url = {https://repo.sadilar.org/handle/20.500.12185/346},
|
170 |
+
}
|
171 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"siswati_ner_corpus": {"description": "Named entity annotated data from the NCHLT Text Resource Development: Phase II Project, annotated with PERSON, LOCATION, ORGANISATION and MISCELLANEOUS tags.\n", "citation": "@inproceedings{siswati_ner_corpus,\n author = {B.B. Malangwane and\n M.N. Kekana and\n S.S. Sedibe and\n B.C. Ndhlovu and\n Roald Eiselen},\n title = {NCHLT Siswati Named Entity Annotated Corpus},\n booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portoro\u017e, Slovenia.},\n year = {2016},\n url = {https://repo.sadilar.org/handle/20.500.12185/346},\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/346", "license": "Creative Commons Attribution 2.5 South Africa 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": 9, "names": ["OUT", "B-PERS", "I-PERS", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "siswati_ner_corpus", "config_name": "siswati_ner_corpus", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3517151, "num_examples": 10798, "dataset_name": "siswati_ner_corpus"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/346/nchlt_siswati_named_entity_annotated_corpus.zip?sequence=3&isAllowed=y": {"num_bytes": 21882224, "checksum": "1939ae4161ecf8974cf35dfa57ef9d6c1b452f85942fecd7f2c1201b30a12b8d"}}, "download_size": 21882224, "post_processing_size": null, "dataset_size": 3517151, "size_in_bytes": 25399375}}
|
dummy/siswati_ner_corpus/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:60cbd1526c98e39e7ed64c45cd4e75181754a1e55d2a9a35462a23a92f4468a0
|
3 |
+
size 1654
|
siswati_ner_corpus.py
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
""" Named entity annotated data from the NCHLT Text Resource Development: Phase II Project for Siswati"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import logging
|
20 |
+
import os
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """\
|
26 |
+
@inproceedings{siswati_ner_corpus,
|
27 |
+
author = {B.B. Malangwane and
|
28 |
+
M.N. Kekana and
|
29 |
+
S.S. Sedibe and
|
30 |
+
B.C. Ndhlovu and
|
31 |
+
Roald Eiselen},
|
32 |
+
title = {NCHLT Siswati Named Entity Annotated Corpus},
|
33 |
+
booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portorož, Slovenia.},
|
34 |
+
year = {2016},
|
35 |
+
url = {https://repo.sadilar.org/handle/20.500.12185/346},
|
36 |
+
}
|
37 |
+
"""
|
38 |
+
|
39 |
+
|
40 |
+
_DESCRIPTION = """\
|
41 |
+
Named entity annotated data from the NCHLT Text Resource Development: Phase II Project, annotated with PERSON, LOCATION, ORGANISATION and MISCELLANEOUS tags.
|
42 |
+
"""
|
43 |
+
|
44 |
+
|
45 |
+
_HOMEPAGE = "https://repo.sadilar.org/handle/20.500.12185/346"
|
46 |
+
|
47 |
+
|
48 |
+
_LICENSE = "Creative Commons Attribution 2.5 South Africa License"
|
49 |
+
|
50 |
+
|
51 |
+
# The HuggingFace dataset library don't host the datasets but only point to the original files
|
52 |
+
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
53 |
+
_URL = "https://repo.sadilar.org/bitstream/handle/20.500.12185/346/nchlt_siswati_named_entity_annotated_corpus.zip?sequence=3&isAllowed=y"
|
54 |
+
|
55 |
+
_EXTRACTED_FILE = "NCHLT Siswati Named Entity Annotated Corpus/Dataset.NCHLT-II.ss.NER.Full.txt"
|
56 |
+
|
57 |
+
|
58 |
+
class SiswatiNerCorpusConfig(datasets.BuilderConfig):
|
59 |
+
"""BuilderConfig for SiswatiNerCorpus"""
|
60 |
+
|
61 |
+
def __init__(self, **kwargs):
|
62 |
+
"""BuilderConfig for SiswatiNerCorpus.
|
63 |
+
Args:
|
64 |
+
**kwargs: keyword arguments forwarded to super.
|
65 |
+
"""
|
66 |
+
super(SiswatiNerCorpusConfig, self).__init__(**kwargs)
|
67 |
+
|
68 |
+
|
69 |
+
class SiswatiNerCorpus(datasets.GeneratorBasedBuilder):
|
70 |
+
""" SiswatiNerCorpus Ner dataset"""
|
71 |
+
|
72 |
+
BUILDER_CONFIGS = [
|
73 |
+
SiswatiNerCorpusConfig(
|
74 |
+
name="siswati_ner_corpus",
|
75 |
+
version=datasets.Version("1.0.0"),
|
76 |
+
description="SiswatiNerCorpus dataset",
|
77 |
+
),
|
78 |
+
]
|
79 |
+
|
80 |
+
def _info(self):
|
81 |
+
return datasets.DatasetInfo(
|
82 |
+
description=_DESCRIPTION,
|
83 |
+
features=datasets.Features(
|
84 |
+
{
|
85 |
+
"id": datasets.Value("string"),
|
86 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
87 |
+
"ner_tags": datasets.Sequence(
|
88 |
+
datasets.features.ClassLabel(
|
89 |
+
names=[
|
90 |
+
"OUT",
|
91 |
+
"B-PERS",
|
92 |
+
"I-PERS",
|
93 |
+
"B-ORG",
|
94 |
+
"I-ORG",
|
95 |
+
"B-LOC",
|
96 |
+
"I-LOC",
|
97 |
+
"B-MISC",
|
98 |
+
"I-MISC",
|
99 |
+
]
|
100 |
+
)
|
101 |
+
),
|
102 |
+
}
|
103 |
+
),
|
104 |
+
supervised_keys=None,
|
105 |
+
homepage=_HOMEPAGE,
|
106 |
+
license=_LICENSE,
|
107 |
+
citation=_CITATION,
|
108 |
+
)
|
109 |
+
|
110 |
+
def _split_generators(self, dl_manager):
|
111 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
112 |
+
return [
|
113 |
+
datasets.SplitGenerator(
|
114 |
+
name=datasets.Split.TRAIN,
|
115 |
+
gen_kwargs={"filepath": os.path.join(data_dir, _EXTRACTED_FILE)},
|
116 |
+
),
|
117 |
+
]
|
118 |
+
|
119 |
+
def _generate_examples(self, filepath):
|
120 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
121 |
+
with open(filepath, encoding="utf-8") as f:
|
122 |
+
guid = 0
|
123 |
+
tokens = []
|
124 |
+
ner_tags = []
|
125 |
+
for line in f:
|
126 |
+
if line == "" or line == "\n":
|
127 |
+
if tokens:
|
128 |
+
yield guid, {
|
129 |
+
"id": str(guid),
|
130 |
+
"tokens": tokens,
|
131 |
+
"ner_tags": ner_tags,
|
132 |
+
}
|
133 |
+
guid += 1
|
134 |
+
tokens = []
|
135 |
+
ner_tags = []
|
136 |
+
else:
|
137 |
+
splits = line.split("\t")
|
138 |
+
tokens.append(splits[0])
|
139 |
+
ner_tags.append(splits[1].rstrip())
|
140 |
+
yield guid, {
|
141 |
+
"id": str(guid),
|
142 |
+
"tokens": tokens,
|
143 |
+
"ner_tags": ner_tags,
|
144 |
+
}
|