upload the first config

#4
README.md CHANGED
@@ -1,17 +1,102 @@
1
  ---
 
 
2
  license: cc-by-4.0
3
  multilinguality:
4
  - monolingual
 
 
5
  task_categories:
6
  - token-classification
7
  task_ids:
8
  - named-entity-recognition
9
- language:
10
- - kk
11
  pretty_name: A Named Entity Recognition Dataset for Kazakh
12
- size_categories:
13
- - 100K<n<1M
14
  viewer: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
  # A Named Entity Recognition Dataset for Kazakh
17
  - This is a modified version of the dataset provided in the [LREC 2022](https://lrec2022.lrec-conf.org/en/) paper [*KazNERD: Kazakh Named Entity Recognition Dataset*](https://aclanthology.org/2022.lrec-1.44).
 
1
  ---
2
+ language:
3
+ - kk
4
  license: cc-by-4.0
5
  multilinguality:
6
  - monolingual
7
+ size_categories:
8
+ - 100K<n<1M
9
  task_categories:
10
  - token-classification
11
  task_ids:
12
  - named-entity-recognition
 
 
13
  pretty_name: A Named Entity Recognition Dataset for Kazakh
 
 
14
  viewer: true
15
+ dataset_info:
16
+ config_name: ner_kazakh
17
+ features:
18
+ - name: index
19
+ dtype: string
20
+ - name: sentence_id
21
+ dtype: string
22
+ - name: tokens
23
+ sequence: string
24
+ - name: ner_tags
25
+ sequence:
26
+ class_label:
27
+ names:
28
+ '0': O
29
+ '1': B-ADAGE
30
+ '2': I-ADAGE
31
+ '3': B-ART
32
+ '4': I-ART
33
+ '5': B-CARDINAL
34
+ '6': I-CARDINAL
35
+ '7': B-CONTACT
36
+ '8': I-CONTACT
37
+ '9': B-DATE
38
+ '10': I-DATE
39
+ '11': B-DISEASE
40
+ '12': I-DISEASE
41
+ '13': B-EVENT
42
+ '14': I-EVENT
43
+ '15': B-FACILITY
44
+ '16': I-FACILITY
45
+ '17': B-GPE
46
+ '18': I-GPE
47
+ '19': B-LANGUAGE
48
+ '20': I-LANGUAGE
49
+ '21': B-LAW
50
+ '22': I-LAW
51
+ '23': B-LOCATION
52
+ '24': I-LOCATION
53
+ '25': B-MISCELLANEOUS
54
+ '26': I-MISCELLANEOUS
55
+ '27': B-MONEY
56
+ '28': I-MONEY
57
+ '29': B-NON_HUMAN
58
+ '30': I-NON_HUMAN
59
+ '31': B-NORP
60
+ '32': I-NORP
61
+ '33': B-ORDINAL
62
+ '34': I-ORDINAL
63
+ '35': B-ORGANISATION
64
+ '36': I-ORGANISATION
65
+ '37': B-PERSON
66
+ '38': I-PERSON
67
+ '39': B-PERCENTAGE
68
+ '40': I-PERCENTAGE
69
+ '41': B-POSITION
70
+ '42': I-POSITION
71
+ '43': B-PRODUCT
72
+ '44': I-PRODUCT
73
+ '45': B-PROJECT
74
+ '46': I-PROJECT
75
+ '47': B-QUANTITY
76
+ '48': I-QUANTITY
77
+ '49': B-TIME
78
+ '50': I-TIME
79
+ splits:
80
+ - name: train
81
+ num_bytes: 26219395
82
+ num_examples: 88540
83
+ - name: validation
84
+ num_bytes: 3268409
85
+ num_examples: 11067
86
+ - name: test
87
+ num_bytes: 3252196
88
+ num_examples: 11068
89
+ download_size: 9016377
90
+ dataset_size: 32740000
91
+ configs:
92
+ - config_name: ner_kazakh
93
+ data_files:
94
+ - split: train
95
+ path: ner_kazakh/train-*
96
+ - split: validation
97
+ path: ner_kazakh/validation-*
98
+ - split: test
99
+ path: ner_kazakh/test-*
100
  ---
101
  # A Named Entity Recognition Dataset for Kazakh
102
  - This is a modified version of the dataset provided in the [LREC 2022](https://lrec2022.lrec-conf.org/en/) paper [*KazNERD: Kazakh Named Entity Recognition Dataset*](https://aclanthology.org/2022.lrec-1.44).
ner-kazakh.py DELETED
@@ -1,158 +0,0 @@
1
- """ner_kazakh"""
2
-
3
- import os
4
- import re
5
-
6
- import datasets
7
-
8
- logger = datasets.logging.get_logger(__name__)
9
-
10
- _CITATION = """\
11
- """
12
-
13
- _DESCRIPTION = "ner_kazakh"
14
- _URL = "./"
15
- _TRAINING_FILE = "ner_kazakh_train.txt"
16
- _DEV_FILE = "ner_kazakh_valid.txt"
17
- _TEST_FILE = "ner_kazakh_test.txt"
18
-
19
- class ner_kazakhConfig(datasets.BuilderConfig):
20
- """BuilderConfig for ner_kazakh"""
21
-
22
- def __init__(self, **kwargs):
23
- """BuilderConfig for ner_kazakh.
24
- Args:
25
- **kwargs: keyword arguments forwarded to super.
26
- """
27
- super(ner_kazakhConfig, self).__init__(**kwargs)
28
-
29
- class ner_kazakh(datasets.GeneratorBasedBuilder):
30
- """ner_kazakh dataset."""
31
-
32
- BUILDER_CONFIGS = [
33
- ner_kazakhConfig(name = "ner_kazakh", version = datasets.Version("1.0.0"), description = "ner_kazakh"),
34
- ]
35
-
36
- def _info(self):
37
- return datasets.DatasetInfo(
38
- description =_DESCRIPTION,
39
- features = datasets.Features(
40
- {
41
- "index": datasets.Value("string"),
42
- "sentence_id": datasets.Value("string"),
43
- "tokens": datasets.Sequence(datasets.Value("string")),
44
- "ner_tags": datasets.Sequence(
45
- datasets.features.ClassLabel(
46
- names = [
47
- "O",
48
- "B-ADAGE",
49
- "I-ADAGE",
50
- "B-ART",
51
- "I-ART",
52
- "B-CARDINAL",
53
- "I-CARDINAL",
54
- "B-CONTACT",
55
- "I-CONTACT",
56
- "B-DATE",
57
- "I-DATE",
58
- "B-DISEASE",
59
- "I-DISEASE",
60
- "B-EVENT",
61
- "I-EVENT",
62
- "B-FACILITY",
63
- "I-FACILITY",
64
- "B-GPE",
65
- "I-GPE",
66
- "B-LANGUAGE",
67
- "I-LANGUAGE",
68
- "B-LAW",
69
- "I-LAW",
70
- "B-LOCATION",
71
- "I-LOCATION",
72
- "B-MISCELLANEOUS",
73
- "I-MISCELLANEOUS",
74
- "B-MONEY",
75
- "I-MONEY",
76
- "B-NON_HUMAN",
77
- "I-NON_HUMAN",
78
- "B-NORP",
79
- "I-NORP",
80
- "B-ORDINAL",
81
- "I-ORDINAL",
82
- "B-ORGANISATION",
83
- "I-ORGANISATION",
84
- "B-PERSON",
85
- "I-PERSON",
86
- "B-PERCENTAGE",
87
- "I-PERCENTAGE",
88
- "B-POSITION",
89
- "I-POSITION",
90
- "B-PRODUCT",
91
- "I-PRODUCT",
92
- "B-PROJECT",
93
- "I-PROJECT",
94
- "B-QUANTITY",
95
- "I-QUANTITY",
96
- "B-TIME",
97
- "I-TIME",
98
- ]
99
- )
100
- ),
101
- }
102
- ),
103
- supervised_keys = None,
104
- homepage = "",
105
- citation = _CITATION,
106
- )
107
-
108
- def _split_generators(self, dl_manager):
109
- """Returns SplitGenerators."""
110
- data_files = {
111
- "train": f"{_URL}{_TRAINING_FILE}",
112
- "dev": f"{_URL}{_DEV_FILE}",
113
- "test": f"{_URL}{_TEST_FILE}",
114
- }
115
- downloaded_files = dl_manager.download_and_extract(data_files)
116
-
117
- return [
118
- datasets.SplitGenerator(name = datasets.Split.TRAIN, gen_kwargs = {"filepath": downloaded_files["train"]}),
119
- datasets.SplitGenerator(name = datasets.Split.VALIDATION, gen_kwargs = {"filepath": downloaded_files["dev"]}),
120
- datasets.SplitGenerator(name = datasets.Split.TEST, gen_kwargs = {"filepath": downloaded_files["test"]}),
121
- ]
122
-
123
- def _generate_examples(self, filepath):
124
- logger.info("⏳ Generating examples from = %s", filepath)
125
- with open(filepath, encoding="utf-8") as f:
126
- index = 0
127
- sent_ids = []
128
- tokens = []
129
- ner_tags = []
130
- for line in f:
131
- if line.startswith("-DOCSTART-") or line == "" or line == "\n":
132
- if tokens:
133
- yield index, {
134
- "index": str(index),
135
- "sentence_id": sent_ids,
136
- "tokens": tokens,
137
- "ner_tags": ner_tags,
138
- }
139
- index += 1
140
- sent_ids = []
141
- tokens = []
142
- ner_tags = []
143
- else:
144
- # ner_kazakh tokens are space separated
145
- splits = line.split(" ")
146
- if re.match(r"[A-Z]{3}\d{6}[A-Z]{3}", line):
147
- sent_ids.append(splits[0])
148
- else:
149
- tokens.append(splits[0])
150
- ner_tags.append(splits[1].rstrip())
151
- # last example
152
- if tokens:
153
- yield index, {
154
- "index": str(index),
155
- "sentence_id": sent_ids,
156
- "tokens": tokens,
157
- "ner_tags": ner_tags,
158
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ner_kazakh/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:045fc74f82eeff1a60b77696945d2692dd0a4e594465dd683cfacb2614001ce7
3
+ size 903618
ner_kazakh/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d61e2d7810fd56ce65deccfdc4e0f15661f8f9482a5c19cbccdb548569bb4a5e
3
+ size 7209684
ner_kazakh/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cb639a20c4858eb3c84094d5fd04c3133fa79f9b9e8d274f518517d9c6bb582
3
+ size 903075