Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
Xhosa
Size:
1K<n<10K
License:
Commit
•
8613387
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 +166 -0
- dataset_infos.json +1 -0
- dummy/isixhosa_ner_corpus/1.0.0/dummy_data.zip +3 -0
- isixhosa_ner_corpus.py +131 -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,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- xh
|
8 |
+
licenses:
|
9 |
+
- other-Creative Commons Attribution 2-5 South Africa License
|
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 |
+
- [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:** [IsiXhosa Ner Corpus Homepage](https://repo.sadilar.org/handle/20.500.12185/312)
|
50 |
+
- **Repository:**
|
51 |
+
- **Paper:**
|
52 |
+
- **Leaderboard:**
|
53 |
+
- **Point of Contact:** [Martin Puttkammer](mailto:[email protected])
|
54 |
+
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
The isiXhosa Ner Corpus is a Xhosa 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 Xhosa language. The dataset uses CoNLL shared task annotation standards.
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
The language supported is Xhosa.
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
A data point consists of sentences seperated by empty line and tab-seperated tokens and tags.
|
73 |
+
{'id': '0',
|
74 |
+
'ner_tags': [7, 8, 5, 6, 0],
|
75 |
+
'tokens': ['Injongo', 'ye-website', 'yaseMzantsi', 'Afrika', 'kukuvelisa']
|
76 |
+
}
|
77 |
+
|
78 |
+
### Data Fields
|
79 |
+
|
80 |
+
- `id`: id of the sample
|
81 |
+
- `tokens`: the tokens of the example text
|
82 |
+
- `ner_tags`: the NER tags of each token
|
83 |
+
|
84 |
+
The NER tags correspond to this list:
|
85 |
+
```
|
86 |
+
"OUT", "B-PERS", "I-PERS", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC",
|
87 |
+
```
|
88 |
+
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.
|
89 |
+
|
90 |
+
### Data Splits
|
91 |
+
|
92 |
+
The data was not split.
|
93 |
+
|
94 |
+
## Dataset Creation
|
95 |
+
|
96 |
+
### Curation Rationale
|
97 |
+
|
98 |
+
The data was created to help introduce resources to new language - Xhosa.
|
99 |
+
|
100 |
+
[More Information Needed]
|
101 |
+
|
102 |
+
### Source Data
|
103 |
+
|
104 |
+
#### Initial Data Collection and Normalization
|
105 |
+
|
106 |
+
The data is based on South African government domain and was crawled from gov.za websites.
|
107 |
+
|
108 |
+
[More Information Needed]
|
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 |
+
### Annotations
|
115 |
+
|
116 |
+
#### Annotation process
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
#### Who are the annotators?
|
121 |
+
|
122 |
+
The data was annotated during the NCHLT text resource development project.
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
### Personal and Sensitive Information
|
127 |
+
[More Information Needed]
|
128 |
+
|
129 |
+
## Considerations for Using the Data
|
130 |
+
|
131 |
+
### Social Impact of Dataset
|
132 |
+
|
133 |
+
[More Information Needed]
|
134 |
+
|
135 |
+
### Discussion of Biases
|
136 |
+
|
137 |
+
[More Information Needed]
|
138 |
+
|
139 |
+
### Other Known Limitations
|
140 |
+
|
141 |
+
[More Information Needed]
|
142 |
+
|
143 |
+
## Additional Information
|
144 |
+
|
145 |
+
### Dataset Curators
|
146 |
+
|
147 |
+
The annotated data sets were developed by the Centre for Text Technology (CTexT, North-West University, South Africa).
|
148 |
+
|
149 |
+
See: [more information](http://www.nwu.ac.za/ctext)
|
150 |
+
|
151 |
+
### Licensing Information
|
152 |
+
|
153 |
+
The data is under the [Creative Commons Attribution 2.5 South Africa License](http://creativecommons.org/licenses/by/2.5/za/legalcode)
|
154 |
+
|
155 |
+
### Citation Information
|
156 |
+
|
157 |
+
```
|
158 |
+
@inproceedings{isixhosa_ner_corpus,
|
159 |
+
author = { K. Podile and
|
160 |
+
Roald Eiselen},
|
161 |
+
title = {NCHLT isiXhosa Named Entity Annotated Corpus},
|
162 |
+
booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portorož, Slovenia.},
|
163 |
+
year = {2016},
|
164 |
+
url = {https://repo.sadilar.org/handle/20.500.12185/312},
|
165 |
+
}
|
166 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"isixhosa_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{isixhosa_ner_corpus,\n author = {K. Podile and\n Roald Eiselen},\n title = {NCHLT isiXhosa 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/312},\n}\n", "homepage": "https://repo.sadilar.org/handle/20.500.12185/312", "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": "isixhosa_ner_corpus", "config_name": "isixhosa_ner_corpus", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2414995, "num_examples": 6284, "dataset_name": "isixhosa_ner_corpus"}}, "download_checksums": {"https://repo.sadilar.org/bitstream/handle/20.500.12185/312/nchlt_isixhosa_named_entity_annotated_corpus.zip?sequence=3&isAllowed=y": {"num_bytes": 14513302, "checksum": "38bb7642e4663b70f81efff5b2d7c81ba7b2ec8defc244c00f33bc113b7afca4"}}, "download_size": 14513302, "post_processing_size": null, "dataset_size": 2414995, "size_in_bytes": 16928297}}
|
dummy/isixhosa_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:4f4d13462a088bdc7013bfa75794be87030b23a2326b3677d3364f31fc1467a1
|
3 |
+
size 1699
|
isixhosa_ner_corpus.py
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 IsiXhosa"""
|
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{isixhosa_ner_corpus,
|
27 |
+
author = {K. Podile and
|
28 |
+
Roald Eiselen},
|
29 |
+
title = {NCHLT isiXhosa Named Entity Annotated Corpus},
|
30 |
+
booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portorož, Slovenia.},
|
31 |
+
year = {2016},
|
32 |
+
url = {https://repo.sadilar.org/handle/20.500.12185/312},
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
Named entity annotated data from the NCHLT Text Resource Development: Phase II Project, annotated with PERSON, LOCATION, ORGANISATION and MISCELLANEOUS tags.
|
38 |
+
"""
|
39 |
+
|
40 |
+
_URL = "https://repo.sadilar.org/bitstream/handle/20.500.12185/312/nchlt_isixhosa_named_entity_annotated_corpus.zip?sequence=3&isAllowed=y"
|
41 |
+
|
42 |
+
|
43 |
+
_EXTRACTED_FILE = "NCHLT isiXhosa Named Entity Annotated Corpus/Dataset.NCHLT-II.xh.NER.Full.txt"
|
44 |
+
|
45 |
+
|
46 |
+
class IsixhosaNerCorpusConfig(datasets.BuilderConfig):
|
47 |
+
"""BuilderConfig for IsixhosaNerCorpusConfig"""
|
48 |
+
|
49 |
+
def __init__(self, **kwargs):
|
50 |
+
"""BuilderConfig for IsixhosaNerCorpusConfig.
|
51 |
+
Args:
|
52 |
+
**kwargs: keyword arguments forwarded to super.
|
53 |
+
"""
|
54 |
+
super(IsixhosaNerCorpusConfig, self).__init__(**kwargs)
|
55 |
+
|
56 |
+
|
57 |
+
class IsixhosaNerCorpus(datasets.GeneratorBasedBuilder):
|
58 |
+
""" Isizulu Ner dataset"""
|
59 |
+
|
60 |
+
BUILDER_CONFIGS = [
|
61 |
+
IsixhosaNerCorpusConfig(
|
62 |
+
name="isixhosa_ner_corpus",
|
63 |
+
version=datasets.Version("1.0.0"),
|
64 |
+
description="IsixhosaNerCorpus dataset",
|
65 |
+
),
|
66 |
+
]
|
67 |
+
|
68 |
+
def _info(self):
|
69 |
+
return datasets.DatasetInfo(
|
70 |
+
description=_DESCRIPTION,
|
71 |
+
features=datasets.Features(
|
72 |
+
{
|
73 |
+
"id": datasets.Value("string"),
|
74 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
75 |
+
"ner_tags": datasets.Sequence(
|
76 |
+
datasets.features.ClassLabel(
|
77 |
+
names=[
|
78 |
+
"OUT",
|
79 |
+
"B-PERS",
|
80 |
+
"I-PERS",
|
81 |
+
"B-ORG",
|
82 |
+
"I-ORG",
|
83 |
+
"B-LOC",
|
84 |
+
"I-LOC",
|
85 |
+
"B-MISC",
|
86 |
+
"I-MISC",
|
87 |
+
]
|
88 |
+
)
|
89 |
+
),
|
90 |
+
}
|
91 |
+
),
|
92 |
+
supervised_keys=None,
|
93 |
+
homepage="https://repo.sadilar.org/handle/20.500.12185/312",
|
94 |
+
citation=_CITATION,
|
95 |
+
)
|
96 |
+
|
97 |
+
def _split_generators(self, dl_manager):
|
98 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
99 |
+
return [
|
100 |
+
datasets.SplitGenerator(
|
101 |
+
name=datasets.Split.TRAIN,
|
102 |
+
gen_kwargs={"filepath": os.path.join(data_dir, _EXTRACTED_FILE)},
|
103 |
+
),
|
104 |
+
]
|
105 |
+
|
106 |
+
def _generate_examples(self, filepath):
|
107 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
108 |
+
with open(filepath, encoding="utf-8") as f:
|
109 |
+
guid = 0
|
110 |
+
tokens = []
|
111 |
+
ner_tags = []
|
112 |
+
for line in f:
|
113 |
+
if line == "" or line == "\n":
|
114 |
+
if tokens:
|
115 |
+
yield guid, {
|
116 |
+
"id": str(guid),
|
117 |
+
"tokens": tokens,
|
118 |
+
"ner_tags": ner_tags,
|
119 |
+
}
|
120 |
+
guid += 1
|
121 |
+
tokens = []
|
122 |
+
ner_tags = []
|
123 |
+
else:
|
124 |
+
splits = line.split("\t")
|
125 |
+
tokens.append(splits[0])
|
126 |
+
ner_tags.append(splits[1].rstrip())
|
127 |
+
yield guid, {
|
128 |
+
"id": str(guid),
|
129 |
+
"tokens": tokens,
|
130 |
+
"ner_tags": ner_tags,
|
131 |
+
}
|