Datasets:
Tasks:
Token Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
named-entity-recognition
Languages:
Pedi
Size:
1K - 10K
License:
Commit
•
e7f2700
1
Parent(s):
b57ae7c
Convert dataset to Parquet (#3)
Browse files- Convert dataset to Parquet (ce8321feacb59ce4c67712520cfea08b2ec67642)
- Delete loading script (e40acfd34d85b4a061a352a1caac5978d91d8975)
- README.md +10 -4
- sepedi_ner.py +0 -136
- sepedi_ner/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -20,6 +20,7 @@ task_ids:
|
|
20 |
pretty_name: Sepedi NER Corpus
|
21 |
license_details: Creative Commons Attribution 2.5 South Africa License
|
22 |
dataset_info:
|
|
|
23 |
features:
|
24 |
- name: id
|
25 |
dtype: string
|
@@ -38,13 +39,18 @@ dataset_info:
|
|
38 |
'6': I-LOC
|
39 |
'7': B-MISC
|
40 |
'8': I-MISC
|
41 |
-
config_name: sepedi_ner
|
42 |
splits:
|
43 |
- name: train
|
44 |
-
num_bytes:
|
45 |
num_examples: 7117
|
46 |
-
download_size:
|
47 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
---
|
49 |
|
50 |
# Dataset Card for Sepedi NER Corpus
|
|
|
20 |
pretty_name: Sepedi NER Corpus
|
21 |
license_details: Creative Commons Attribution 2.5 South Africa License
|
22 |
dataset_info:
|
23 |
+
config_name: sepedi_ner
|
24 |
features:
|
25 |
- name: id
|
26 |
dtype: string
|
|
|
39 |
'6': I-LOC
|
40 |
'7': B-MISC
|
41 |
'8': I-MISC
|
|
|
42 |
splits:
|
43 |
- name: train
|
44 |
+
num_bytes: 3378118
|
45 |
num_examples: 7117
|
46 |
+
download_size: 716489
|
47 |
+
dataset_size: 3378118
|
48 |
+
configs:
|
49 |
+
- config_name: sepedi_ner
|
50 |
+
data_files:
|
51 |
+
- split: train
|
52 |
+
path: sepedi_ner/train-*
|
53 |
+
default: true
|
54 |
---
|
55 |
|
56 |
# Dataset Card for Sepedi NER Corpus
|
sepedi_ner.py
DELETED
@@ -1,136 +0,0 @@
|
|
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 Sepedi"""
|
16 |
-
|
17 |
-
|
18 |
-
import os
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
logger = datasets.logging.get_logger(__name__)
|
24 |
-
|
25 |
-
|
26 |
-
_CITATION = """\
|
27 |
-
@inproceedings{sepedi_ner,
|
28 |
-
author = {D.J. Prinsloo and
|
29 |
-
Roald Eiselen},
|
30 |
-
title = {NCHLT Sepedi Named Entity Annotated Corpus},
|
31 |
-
booktitle = {Eiselen, R. 2016. Government domain named entity recognition for South African languages. Proceedings of the 10th Language Resource and Evaluation Conference, Portorož, Slovenia.},
|
32 |
-
year = {2016},
|
33 |
-
url = {https://repo.sadilar.org/handle/20.500.12185/328},
|
34 |
-
}
|
35 |
-
"""
|
36 |
-
|
37 |
-
_DESCRIPTION = """\
|
38 |
-
Named entity annotated data from the NCHLT Text Resource Development: Phase II Project, annotated with PERSON, LOCATION, ORGANISATION and MISCELLANEOUS tags.
|
39 |
-
"""
|
40 |
-
|
41 |
-
_URL = "https://repo.sadilar.org/bitstream/handle/20.500.12185/328/nchlt_sepedi_named_entity_annotated_corpus.zip?sequence=3&isAllowed=y"
|
42 |
-
|
43 |
-
_EXTRACTED_FILE = "NCHLT Sepedi Named Entity Annotated Corpus/Dataset.NCHLT-II.NSO.NER.Full.txt"
|
44 |
-
|
45 |
-
_HOMEPAGE = "https://repo.sadilar.org/handle/20.500.12185/328"
|
46 |
-
|
47 |
-
_LICENCE = "Creative Commons Attribution 2.5 South Africa License"
|
48 |
-
|
49 |
-
|
50 |
-
class SepediNerConfig(datasets.BuilderConfig):
|
51 |
-
"""BuilderConfig for SepediNer"""
|
52 |
-
|
53 |
-
def __init__(self, **kwargs):
|
54 |
-
"""BuilderConfig for SepediNer.
|
55 |
-
Args:
|
56 |
-
**kwargs: keyword arguments forwarded to super.
|
57 |
-
"""
|
58 |
-
super(SepediNerConfig, self).__init__(**kwargs)
|
59 |
-
|
60 |
-
|
61 |
-
class SepediNer(datasets.GeneratorBasedBuilder):
|
62 |
-
"""Sepedi Ner dataset"""
|
63 |
-
|
64 |
-
BUILDER_CONFIGS = [
|
65 |
-
SepediNerConfig(
|
66 |
-
name="sepedi_ner",
|
67 |
-
version=datasets.Version("1.0.0"),
|
68 |
-
description="SepediNer dataset",
|
69 |
-
),
|
70 |
-
]
|
71 |
-
|
72 |
-
def _info(self):
|
73 |
-
return datasets.DatasetInfo(
|
74 |
-
description=_DESCRIPTION,
|
75 |
-
features=datasets.Features(
|
76 |
-
{
|
77 |
-
"id": datasets.Value("string"),
|
78 |
-
"tokens": datasets.Sequence(datasets.Value("string")),
|
79 |
-
"ner_tags": datasets.Sequence(
|
80 |
-
datasets.features.ClassLabel(
|
81 |
-
names=[
|
82 |
-
"OUT",
|
83 |
-
"B-PERS",
|
84 |
-
"I-PERS",
|
85 |
-
"B-ORG",
|
86 |
-
"I-ORG",
|
87 |
-
"B-LOC",
|
88 |
-
"I-LOC",
|
89 |
-
"B-MISC",
|
90 |
-
"I-MISC",
|
91 |
-
]
|
92 |
-
)
|
93 |
-
),
|
94 |
-
}
|
95 |
-
),
|
96 |
-
supervised_keys=None,
|
97 |
-
homepage=_HOMEPAGE,
|
98 |
-
license=_LICENCE,
|
99 |
-
citation=_CITATION,
|
100 |
-
)
|
101 |
-
|
102 |
-
def _split_generators(self, dl_manager):
|
103 |
-
data_dir = dl_manager.download_and_extract(_URL)
|
104 |
-
return [
|
105 |
-
datasets.SplitGenerator(
|
106 |
-
name=datasets.Split.TRAIN,
|
107 |
-
gen_kwargs={"filepath": os.path.join(data_dir, _EXTRACTED_FILE)},
|
108 |
-
),
|
109 |
-
]
|
110 |
-
|
111 |
-
def _generate_examples(self, filepath):
|
112 |
-
logger.info("⏳ Generating examples from = %s", filepath)
|
113 |
-
with open(filepath, encoding="utf-8") as f:
|
114 |
-
guid = 0
|
115 |
-
tokens = []
|
116 |
-
ner_tags = []
|
117 |
-
for line in f:
|
118 |
-
if line == "" or line == "\n":
|
119 |
-
if tokens:
|
120 |
-
yield guid, {
|
121 |
-
"id": str(guid),
|
122 |
-
"tokens": tokens,
|
123 |
-
"ner_tags": ner_tags,
|
124 |
-
}
|
125 |
-
guid += 1
|
126 |
-
tokens = []
|
127 |
-
ner_tags = []
|
128 |
-
else:
|
129 |
-
splits = line.split("\t")
|
130 |
-
tokens.append(splits[0])
|
131 |
-
ner_tags.append(splits[1].rstrip())
|
132 |
-
yield guid, {
|
133 |
-
"id": str(guid),
|
134 |
-
"tokens": tokens,
|
135 |
-
"ner_tags": ner_tags,
|
136 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sepedi_ner/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61320106f2457701d3c74dc2ded5681c23a269eb8dfb1d6f90710f9a4cf300c9
|
3 |
+
size 716489
|