parquet-converter commited on
Commit
d1a9571
1 Parent(s): 8200f8a

Update parquet files

Browse files
Files changed (50) hide show
  1. README.md +0 -248
  2. amh/masakhanews-test.parquet +3 -0
  3. amh/masakhanews-train.parquet +3 -0
  4. amh/masakhanews-validation.parquet +3 -0
  5. eng/masakhanews-test.parquet +3 -0
  6. eng/masakhanews-train.parquet +3 -0
  7. eng/masakhanews-validation.parquet +3 -0
  8. fra/masakhanews-test.parquet +3 -0
  9. fra/masakhanews-train.parquet +3 -0
  10. fra/masakhanews-validation.parquet +3 -0
  11. hau/masakhanews-test.parquet +3 -0
  12. hau/masakhanews-train.parquet +3 -0
  13. hau/masakhanews-validation.parquet +3 -0
  14. ibo/masakhanews-test.parquet +3 -0
  15. ibo/masakhanews-train.parquet +3 -0
  16. ibo/masakhanews-validation.parquet +3 -0
  17. lin/masakhanews-test.parquet +3 -0
  18. lin/masakhanews-train.parquet +3 -0
  19. lin/masakhanews-validation.parquet +3 -0
  20. lug/masakhanews-test.parquet +3 -0
  21. lug/masakhanews-train.parquet +3 -0
  22. lug/masakhanews-validation.parquet +3 -0
  23. masakhanews.py +0 -152
  24. orm/masakhanews-test.parquet +3 -0
  25. orm/masakhanews-train.parquet +3 -0
  26. orm/masakhanews-validation.parquet +3 -0
  27. pcm/masakhanews-test.parquet +3 -0
  28. pcm/masakhanews-train.parquet +3 -0
  29. pcm/masakhanews-validation.parquet +3 -0
  30. run/masakhanews-test.parquet +3 -0
  31. run/masakhanews-train.parquet +3 -0
  32. run/masakhanews-validation.parquet +3 -0
  33. sna/masakhanews-test.parquet +3 -0
  34. sna/masakhanews-train.parquet +3 -0
  35. sna/masakhanews-validation.parquet +3 -0
  36. som/masakhanews-test.parquet +3 -0
  37. som/masakhanews-train.parquet +3 -0
  38. som/masakhanews-validation.parquet +3 -0
  39. swa/masakhanews-test.parquet +3 -0
  40. swa/masakhanews-train.parquet +3 -0
  41. swa/masakhanews-validation.parquet +3 -0
  42. tir/masakhanews-test.parquet +3 -0
  43. tir/masakhanews-train.parquet +3 -0
  44. tir/masakhanews-validation.parquet +3 -0
  45. xho/masakhanews-test.parquet +3 -0
  46. xho/masakhanews-train.parquet +3 -0
  47. xho/masakhanews-validation.parquet +3 -0
  48. yor/masakhanews-test.parquet +3 -0
  49. yor/masakhanews-train.parquet +3 -0
  50. yor/masakhanews-validation.parquet +3 -0
README.md DELETED
@@ -1,248 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - expert-generated
4
- language:
5
- - am
6
- - en
7
- - fr
8
- - ha
9
- - ig
10
- - ln
11
- - lg
12
- - om
13
- - pcm
14
- - rn
15
- - sn
16
- - so
17
- - sw
18
- - ti
19
- - xh
20
- - yo
21
- language_creators:
22
- - expert-generated
23
- license:
24
- - afl-3.0
25
- multilinguality:
26
- - multilingual
27
- pretty_name: masakhanews
28
- size_categories:
29
- - 1K<n<10K
30
- source_datasets:
31
- - original
32
- tags:
33
- - news-topic
34
- - masakhanews
35
- - masakhane
36
- task_categories:
37
- - text-classification
38
- task_ids:
39
- - topic-classification
40
-
41
- ---
42
-
43
-
44
- # Dataset Card for [Dataset Name]
45
-
46
- ## Table of Contents
47
- - [Table of Contents](#table-of-contents)
48
- - [Dataset Description](#dataset-description)
49
- - [Dataset Summary](#dataset-summary)
50
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
51
- - [Languages](#languages)
52
- - [Dataset Structure](#dataset-structure)
53
- - [Data Instances](#data-instances)
54
- - [Data Fields](#data-fields)
55
- - [Data Splits](#data-splits)
56
- - [Dataset Creation](#dataset-creation)
57
- - [Curation Rationale](#curation-rationale)
58
- - [Source Data](#source-data)
59
- - [Annotations](#annotations)
60
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
61
- - [Considerations for Using the Data](#considerations-for-using-the-data)
62
- - [Social Impact of Dataset](#social-impact-of-dataset)
63
- - [Discussion of Biases](#discussion-of-biases)
64
- - [Other Known Limitations](#other-known-limitations)
65
- - [Additional Information](#additional-information)
66
- - [Dataset Curators](#dataset-curators)
67
- - [Licensing Information](#licensing-information)
68
- - [Citation Information](#citation-information)
69
- - [Contributions](#contributions)
70
-
71
- ## Dataset Description
72
-
73
- - **Homepage:** [homepage](https://github.com/masakhane-io/masakhane-news)
74
- - **Repository:** [github](https://github.com/masakhane-io/masakhane-news)
75
- - **Paper:** [paper]()
76
- - **Point of Contact:** [Masakhane](https://www.masakhane.io/) or didelani@lsv.uni-saarland.de
77
-
78
- ### Dataset Summary
79
-
80
- MasakhaNEWS is the largest publicly available dataset for news topic classification in 16 languages widely spoken in Africa.
81
-
82
-
83
- The train/validation/test sets are available for all the 16 languages.
84
-
85
-
86
-
87
- ### Supported Tasks and Leaderboards
88
-
89
- [More Information Needed]
90
-
91
- - `news topic classification`: categorize news articles into new topics e.g business, sport sor politics.
92
-
93
- ### Languages
94
-
95
- There are 16 languages available :
96
- - Amharic (amh)
97
- - English (eng)
98
- - French (fra)
99
- - Hausa (hau)
100
- - Igbo (ibo)
101
- - Lingala (lin)
102
- - Luganda (lug)
103
- - Oromo (orm)
104
- - Nigerian Pidgin (pcm)
105
- - Rundi (run)
106
- - chShona (sna)
107
- - Somali (som)
108
- - Kiswahili (swą)
109
- - Tigrinya (tir)
110
- - isiXhosa (xho)
111
- - Yorùbá (yor)
112
-
113
- ## Dataset Structure
114
-
115
- ### Data Instances
116
-
117
- The examples look like this for Yorùbá:
118
-
119
- ```
120
- from datasets import load_dataset
121
- data = load_dataset('masakhanews', 'yor')
122
-
123
- # Please, specify the language code
124
-
125
- # A data point example is below:
126
-
127
- {
128
- 'label': 0,
129
- 'headline': "'The barriers to entry have gone - go for it now'",
130
- 'text': "j Lalvani, CEO of Vitabiotics and former Dragons' Den star, shares his business advice for our CEO Secrets series.\nProduced, filmed and edited by Dougal Shaw",
131
- 'headline_text': "'The barriers to entry have gone - go for it now' j Lalvani, CEO of Vitabiotics and former Dragons' Den star, shares his business advice for our CEO Secrets series.\nProduced, filmed and edited by Dougal Shaw",
132
- 'url': '/news/business-61880859'
133
- }
134
- ```
135
-
136
- ### Data Fields
137
-
138
- - `label`: news topic id
139
- - `headline`: news title/headline
140
- - `text`: news body
141
- - `headline_text`: concatenation of headline and news body
142
- - `url`: website address
143
-
144
- The news topics correspond to this list:
145
- ```
146
- "business", "entertainment", "health", "politics", "religion", "sports", "technology"
147
- ```
148
-
149
- ### Data Splits
150
-
151
- For all languages, there are three splits.
152
-
153
- The original splits were named `train`, `dev` and `test` and they correspond to the `train`, `validation` and `test` splits.
154
-
155
- The splits have the following sizes :
156
-
157
- | Language | train | validation | test |
158
- |-----------------|------:|-----------:|-----:|
159
- | Amharic | 1311 | 188 | 376 |
160
- | English | 3309 | 472 | 948 |
161
- | French | 1476 | 211 | 422 |
162
- | Hausa | 2219 | 317 | 637 |
163
- | Igbo | 1356 | 194 | 390 |
164
- | Lingala | 608 | 87 | 175 |
165
- | Luganda | 771 | 110 | 223 |
166
- | Oromo | 1015 | 145 | 292 |
167
- | Nigerian-Pidgin | 1060 | 152 | 305 |
168
- | Rundi | 1117 | 159 | 322 |
169
- | chiShona | 1288 | 185 | 369 |
170
- | Somali | 1021 | 148 | 294 |
171
- | Kiswahili | 1658 | 237 | 476 |
172
- | Tigrinya | 947 | 137 | 272 |
173
- | isiXhosa | 1032 | 147 | 297 |
174
- | Yoruba | 1433 | 206 | 411 |
175
-
176
- ## Dataset Creation
177
-
178
- ### Curation Rationale
179
-
180
- The dataset was introduced to introduce new resources to 20 languages that were under-served for natural language processing.
181
-
182
- [More Information Needed]
183
-
184
- ### Source Data
185
-
186
- The source of the data is from the news domain, details can be found here ****
187
-
188
- #### Initial Data Collection and Normalization
189
-
190
- The articles were word-tokenized, information on the exact pre-processing pipeline is unavailable.
191
-
192
- #### Who are the source language producers?
193
-
194
- The source language was produced by journalists and writers employed by the news agency and newspaper mentioned above.
195
-
196
- ### Annotations
197
-
198
- #### Annotation process
199
-
200
- Details can be found here **
201
-
202
- #### Who are the annotators?
203
-
204
- Annotators were recruited from [Masakhane](https://www.masakhane.io/)
205
-
206
- ### Personal and Sensitive Information
207
-
208
- The data is sourced from newspaper source and only contains mentions of public figures or individuals
209
-
210
- ## Considerations for Using the Data
211
-
212
- ### Social Impact of Dataset
213
- [More Information Needed]
214
-
215
-
216
- ### Discussion of Biases
217
- [More Information Needed]
218
-
219
-
220
- ### Other Known Limitations
221
-
222
- Users should keep in mind that the dataset only contains news text, which might limit the applicability of the developed systems to other domains.
223
-
224
- ## Additional Information
225
-
226
- ### Dataset Curators
227
-
228
-
229
- ### Licensing Information
230
-
231
- The licensing status of the data is CC 4.0 Non-Commercial
232
-
233
- ### Citation Information
234
-
235
- Provide the [BibTex](http://www.bibtex.org/)-formatted reference for the dataset. For example:
236
- ```
237
- @article{Adelani2023MasakhaNEWS,
238
- title={MasakhaNEWS: News Topic Classification for African languages},
239
- author={David Ifeoluwa Adelani and Marek Masiak and Israel Abebe Azime and Jesujoba Oluwadara Alabi and Atnafu Lambebo Tonja and Christine Mwase and Odunayo Ogundepo and Bonaventure F. P. Dossou and Akintunde Oladipo and Doreen Nixdorf and Chris Chinenye Emezue and Sana Sabah al-azzawi and Blessing K. Sibanda and Davis David and Lolwethu Ndolela and Jonathan Mukiibi and Tunde Oluwaseyi Ajayi and Tatiana Moteu Ngoli and Brian Odhiambo and Abraham Toluwase Owodunni and Nnaemeka C. Obiefuna and Shamsuddeen Hassan Muhammad and Saheed Salahudeen Abdullahi and Mesay Gemeda Yigezu and Tajuddeen Gwadabe and Idris Abdulmumin and Mahlet Taye Bame and Oluwabusayo Olufunke Awoyomi and Iyanuoluwa Shode and Tolulope Anu Adelani and Habiba Abdulganiy Kailani and Abdul-Hakeem Omotayo and Adetola Adeeko and Afolabi Abeeb and Anuoluwapo Aremu and Olanrewaju Samuel and Clemencia Siro and Wangari Kimotho and Onyekachi Raphael Ogbu and Chinedu E. Mbonu and Chiamaka I. Chukwuneke and Samuel Fanijo and Jessica Ojo and Oyinkansola F. Awosan and Tadesse Kebede Guge and Sakayo Toadoum Sari and Pamela Nyatsine and Freedmore Sidume and Oreen Yousuf and Mardiyyah Oduwole and Ussen Kimanuka and Kanda Patrick Tshinu and Thina Diko and Siyanda Nxakama and Abdulmejid Tuni Johar and Sinodos Gebre and Muhidin Mohamed and Shafie Abdi Mohamed and Fuad Mire Hassan and Moges Ahmed Mehamed and Evrard Ngabire and and Pontus Stenetorp},
240
- journal={ArXiv},
241
- year={2023},
242
- volume={}
243
- }
244
- ```
245
-
246
- ### Contributions
247
-
248
- Thanks to [@dadelani](https://github.com/dadelani) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
amh/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e669fcd5d2ce2b57bf022e4d1442baf43d539b1e09f5148bf10a22a8a70432e
3
+ size 2061060
amh/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cfc6565042c51d2bb108f2af0621bb81889f81b3d994bb64b62fb4f9298c2ea
3
+ size 6686357
amh/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26fc2b70ce72d822d8ef27a1a9dbc4eab026a51dc33f4bee790d4de069560a62
3
+ size 881038
eng/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09cdc288607ae6dc9dfaf4bfe12c202a6294708b796eadb3d01d45c654cf65d6
3
+ size 3643599
eng/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a26d0d8484e727589a0b78e9fd62eb8a16a59d552aeafa75cd04a9fa249d566c
3
+ size 12834184
eng/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c218e66f0610ae59a72b7c50b3ff50b436481a776deb59d594899a406739314
3
+ size 1847305
fra/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2243c447f51467d7b38141057947c49d6afe7265fb2940c2a6bbb02b174a3cea
3
+ size 2646360
fra/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68643e45aecd14cd9848a9d2ec2d4353cceb53b91bde11c3f41f4aec46b5bbc3
3
+ size 9263740
fra/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d41030481f83e740fc59b520ab4ee27206846e327a4fac0e16cd82e8ca702cf
3
+ size 1254883
hau/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4ff5fff29bba11b7bf14ca2478565f00e29f7ac70881350ad0ef46095c8b5c7
3
+ size 1892255
hau/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f960a88c557c152c74abb9647bd0e5749530894b74e88f6559b4476ddd7fd67
3
+ size 6296117
hau/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b85fbf78ef8a573745b0dbcb9fd563a6398f656c890a69c8a80ae3c14dd8fb5d
3
+ size 874914
ibo/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fce332db2abdb45e407fd3e320c06cffd5658421fee64c4c998d112fb728bcec
3
+ size 979327
ibo/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:346b4e245b32fda621400e2e4c7fe6a977121f1ab3b0acc689dcf118cb85c2a3
3
+ size 3313802
ibo/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7389d79b57c368043b61454c3728142da926c8c94904d72a5f9d70e018d989a
3
+ size 527582
lin/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:778888f9f9f828311fb679d41d67c39470b959776ac58eb95ebdfc8028d119c0
3
+ size 242976
lin/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cd406350292429dc4a13ba92f1c5564525f7f0036254f834c767f3baac39756
3
+ size 796599
lin/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:924f25b8acf5a3f5e3fb5497c3fc6a15d09502c85fd98679df75dfb1af5573cb
3
+ size 137363
lug/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61a6f1c6f66ee1c093ab07daf010cf2b40ed4289cd5c921254fa841df5249254
3
+ size 492173
lug/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae49c4dbed553d2e6822ad9be0a6903a8c063e84a7beec60525a2756611d23e2
3
+ size 1672968
lug/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e53558061b67dadb71fa290244ab0a1a16f622f7e7b2ecb12b12276e8bf491d2
3
+ size 262898
masakhanews.py DELETED
@@ -1,152 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 HuggingFace Datasets Authors.
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
-
16
- # Lint as: python3
17
- """MasakhaNEWS: News Topic Classification for African languages"""
18
-
19
- import datasets
20
- import pandas
21
- import pandas as pd
22
-
23
- logger = datasets.logging.get_logger(__name__)
24
-
25
-
26
- _CITATION = """\
27
- @article{Adelani2023MasakhaNEWS,
28
- title={MasakhaNEWS: News Topic Classification for African languages},
29
- author={David Ifeoluwa Adelani and Marek Masiak and Israel Abebe Azime and Jesujoba Oluwadara Alabi and Atnafu Lambebo Tonja and Christine Mwase and Odunayo Ogundepo and Bonaventure F. P. Dossou and Akintunde Oladipo and Doreen Nixdorf and Chris Chinenye Emezue and Sana Sabah al-azzawi and Blessing K. Sibanda and Davis David and Lolwethu Ndolela and Jonathan Mukiibi and Tunde Oluwaseyi Ajayi and Tatiana Moteu Ngoli and Brian Odhiambo and Abraham Toluwase Owodunni and Nnaemeka C. Obiefuna and Shamsuddeen Hassan Muhammad and Saheed Salahudeen Abdullahi and Mesay Gemeda Yigezu and Tajuddeen Gwadabe and Idris Abdulmumin and Mahlet Taye Bame and Oluwabusayo Olufunke Awoyomi and Iyanuoluwa Shode and Tolulope Anu Adelani and Habiba Abdulganiy Kailani and Abdul-Hakeem Omotayo and Adetola Adeeko and Afolabi Abeeb and Anuoluwapo Aremu and Olanrewaju Samuel and Clemencia Siro and Wangari Kimotho and Onyekachi Raphael Ogbu and Chinedu E. Mbonu and Chiamaka I. Chukwuneke and Samuel Fanijo and Jessica Ojo and Oyinkansola F. Awosan and Tadesse Kebede Guge and Sakayo Toadoum Sari and Pamela Nyatsine and Freedmore Sidume and Oreen Yousuf and Mardiyyah Oduwole and Ussen Kimanuka and Kanda Patrick Tshinu and Thina Diko and Siyanda Nxakama and Abdulmejid Tuni Johar and Sinodos Gebre and Muhidin Mohamed and Shafie Abdi Mohamed and Fuad Mire Hassan and Moges Ahmed Mehamed and Evrard Ngabire and and Pontus Stenetorp},
30
- journal={ArXiv},
31
- year={2023},
32
- volume={}
33
- }
34
- """
35
-
36
- _DESCRIPTION = """\
37
- MasakhaNEWS is the largest publicly available dataset for news topic classification in 16 languages widely spoken in Africa.
38
-
39
- The languages are:
40
- - Amharic (amh)
41
- - English (eng)
42
- - French (fra)
43
- - Hausa (hau)
44
- - Igbo (ibo)
45
- - Lingala (lin)
46
- - Luganda (lug)
47
- - Oromo (orm)
48
- - Nigerian Pidgin (pcm)
49
- - Rundi (run)
50
- - chShona (sna)
51
- - Somali (som)
52
- - Kiswahili (swą)
53
- - Tigrinya (tir)
54
- - isiXhosa (xho)
55
- - Yorùbá (yor)
56
-
57
- The train/validation/test sets are available for all the 16 languages.
58
-
59
- For more details see *** arXiv link **
60
- """
61
- _URL = "https://github.com/masakhane-io/masakhane-news/raw/main/data/"
62
- _TRAINING_FILE = "train.tsv"
63
- _DEV_FILE = "dev.tsv"
64
- _TEST_FILE = "test.tsv"
65
-
66
-
67
- class MasakhanewsConfig(datasets.BuilderConfig):
68
- """BuilderConfig for Masakhanews"""
69
-
70
- def __init__(self, **kwargs):
71
- """BuilderConfig for Masakhanews.
72
-
73
- Args:
74
- **kwargs: keyword arguments forwarded to super.
75
- """
76
- super(MasakhanewsConfig, self).__init__(**kwargs)
77
-
78
-
79
- class Masakhanews(datasets.GeneratorBasedBuilder):
80
- """Masakhanews dataset."""
81
-
82
- BUILDER_CONFIGS = [
83
- MasakhanewsConfig(name="amh", version=datasets.Version("1.0.0"), description="Masakhanews Amharic dataset"),
84
- MasakhanewsConfig(name="eng", version=datasets.Version("1.0.0"), description="Masakhanews English dataset"),
85
- MasakhanewsConfig(name="fra", version=datasets.Version("1.0.0"), description="Masakhanews French dataset"),
86
- MasakhanewsConfig(name="hau", version=datasets.Version("1.0.0"), description="Masakhanews Hausa dataset"),
87
- MasakhanewsConfig(name="ibo", version=datasets.Version("1.0.0"), description="Masakhanews Igbo dataset"),
88
- MasakhanewsConfig(name="lin", version=datasets.Version("1.0.0"), description="Masakhanews Lingala dataset"),
89
- MasakhanewsConfig(name="lug", version=datasets.Version("1.0.0"), description="Masakhanews Luganda dataset"),
90
- MasakhanewsConfig(name="orm", version=datasets.Version("1.0.0"), description="Masakhanews Oromo dataset"),
91
- MasakhanewsConfig(
92
- name="pcm", version=datasets.Version("1.0.0"), description="Masakhanews Nigerian-Pidgin dataset"
93
- ),
94
- MasakhanewsConfig(name="run", version=datasets.Version("1.0.0"), description="Masakhanews Rundi dataset"),
95
- MasakhanewsConfig(name="sna", version=datasets.Version("1.0.0"), description="Masakhanews Shona dataset"),
96
- MasakhanewsConfig(name="som", version=datasets.Version("1.0.0"), description="Masakhanews Somali dataset"),
97
- MasakhanewsConfig(name="swa", version=datasets.Version("1.0.0"), description="Masakhanews Swahili dataset"),
98
- MasakhanewsConfig(name="tir", version=datasets.Version("1.0.0"), description="Masakhanews Tigrinya dataset"),
99
- MasakhanewsConfig(name="xho", version=datasets.Version("1.0.0"), description="Masakhanews Xhosa dataset"),
100
- MasakhanewsConfig(name="yor", version=datasets.Version("1.0.0"), description="Masakhanews Yoruba dataset"),
101
- ]
102
-
103
- def _info(self):
104
- return datasets.DatasetInfo(
105
- description=_DESCRIPTION,
106
- features=datasets.Features(
107
- {
108
- "label": datasets.features.ClassLabel(
109
- names=["business", "entertainment", "health", "politics", "religion", "sports", "technology"]
110
- ),
111
- "headline": datasets.Value("string"),
112
- "text": datasets.Value("string"),
113
- "headline_text": datasets.Value("string"),
114
- "url": datasets.Value("string"),
115
- }
116
- ),
117
- supervised_keys=None,
118
- homepage="https://github.com/masakhane-io/masakhane-news",
119
- citation=_CITATION,
120
- )
121
-
122
- def _split_generators(self, dl_manager):
123
- """Returns SplitGenerators."""
124
- urls_to_download = {
125
- "train": f"{_URL}{self.config.name}/{_TRAINING_FILE}",
126
- "dev": f"{_URL}{self.config.name}/{_DEV_FILE}",
127
- "test": f"{_URL}{self.config.name}/{_TEST_FILE}",
128
- }
129
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
130
-
131
- return [
132
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
133
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
134
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
135
- ]
136
-
137
- def _generate_examples(self, filepath):
138
- logger.info("⏳ Generating examples from = %s", filepath)
139
- df = pd.read_csv(filepath, sep='\t')
140
- N = df.shape[0]
141
-
142
- for id_ in range(N):
143
- yield id_, {
144
- "label": df['category'].iloc[id_],
145
- "headline": df['headline'].iloc[id_],
146
- "text": df['text'].iloc[id_],
147
- "headline_text": df['headline'].iloc[id_] + ' ' + df['text'].iloc[id_],
148
- "url": df['url'].iloc[id_],
149
- }
150
-
151
-
152
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
orm/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c2de650250dd3204783a7e1a3bb23e8eb344a85ccf31c23e57d3960b0026f23
3
+ size 1201328
orm/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63b0c751362a66d0085368689d1fd5205cfc33a188046170c0e16e20ca549e45
3
+ size 4354893
orm/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7f3dc34c405b4d88080c7a8541a813b43c0bb8769347fb2b2f6ef99a6a6aab3
3
+ size 636238
pcm/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c19a326dc0263a234290f6b13ca631632fff2491d9b9b1cc0313aa84e959537
3
+ size 939948
pcm/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ae7b605ce27b0a132b7834d1cb4648af1708fa3dbfc91640130010eaa78e996
3
+ size 2996383
pcm/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c8e19aa97776d15e86f7b3f22d1324b17f4781fc6eafb56510638320827ceaa
3
+ size 489131
run/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4ef7d4a21890faa5f33839c52a3f9c8d32d75572e441b4d16ef98a30c175188
3
+ size 1093134
run/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5529367ebde337de87aab6280af7f45a70622ff35ad0ad80987d1cdfaf044bd4
3
+ size 3930658
run/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4c1dd5a2e2039b1cf6c93ff4c5054baf4bfd35846e863d95ae45cdcba9ebd49
3
+ size 609446
sna/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:237f05391cfb4fd15bf9c975129d29a7ada403c32f6a90dc742dd78ff7390f33
3
+ size 852010
sna/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74436f70195db9c3b5d67a31dd1ae70122be9b9a20067b0763f26b8a7e94038f
3
+ size 2949128
sna/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:308ac6313d64d0c11ccbd8960e806a98f7a6671b5423654313603a31dee51da7
3
+ size 419436
som/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:327ce4e672e1ce017b5edd7e42f02ea5d5be2c30a97c28f0a6ba88b2ccd12358
3
+ size 1282746
som/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:180da1050de9781045e3a49e9572c528a2b9f4852e17df1fd22e7a6ea381a061
3
+ size 4546004
som/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:812fbfabb549b1c7d5e863b4851877990e4ae63e0c60b1c53fe739805fed69b3
3
+ size 674855
swa/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:771ab1a2e665b258ebf82efc78c5b3469f10ee1af2067acb2d9ea22581316313
3
+ size 2013856
swa/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1c1c96d4c794d7ef1e3ed915664abf1113f557c1fbde3cab6ca9e4bfa2517bb
3
+ size 7235316
swa/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1199e0e94fd1b37c954dc97fd8b34f33367080cd5a550c897e05c2cda4d3e0fe
3
+ size 999018
tir/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9801c7c3b5fd8698036be15bef812d0d6d41055e82c58384462ee8965e719869
3
+ size 1462730
tir/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0460df6cdd613c7df6da9689a870244d05d379c497fbd18f81ebe34cca62f597
3
+ size 5361499
tir/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4809a7f002fee3b5f167f9b297a80e8e11cf4a6122dd19ac59fd07f36d1a91e6
3
+ size 852548
xho/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8619da52e772f3450320971183b7ee574c2d67d3709f7e2d6104f78f175d97b2
3
+ size 747767
xho/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2210254ce040f9f95af122a6f1a3a857cc05009cafbf39498129a0efb92678b
3
+ size 2611720
xho/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aff5175cd4aecb9398c44e57b00cca23bd07d75889551e06bb4d5ca7b0ee5f35
3
+ size 390419
yor/masakhanews-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9bfa03a3b3225c12214ed6fb6d0ab79f0bdc6e65a65f911ebb5da8a935ecf0bd
3
+ size 1152395
yor/masakhanews-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e57af81c5bf7e5ad7dd19c425a5caa6344118d21a2094068614fd85e60a8a32
3
+ size 4101377
yor/masakhanews-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2405f83d4c15503137609da4c550bef66fc499b12913bdd4f239f1b900134425
3
+ size 581934