Datasets:
Tasks:
Token Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
part-of-speech
Languages:
Arabic
Size:
1K - 10K
ArXiv:
License:
Commit
•
cf9c2d0
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 +207 -0
- arabic_pos_dialect.py +156 -0
- dataset_infos.json +1 -0
- dummy/egy/0.0.0/dummy_data.zip +3 -0
- dummy/glf/0.0.0/dummy_data.zip +3 -0
- dummy/lev/0.0.0/dummy_data.zip +3 -0
- dummy/mgr/0.0.0/dummy_data.zip +3 -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,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- ar
|
8 |
+
licenses:
|
9 |
+
- apache-2-0
|
10 |
+
multilinguality:
|
11 |
+
- multilingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets:
|
15 |
+
- extended
|
16 |
+
task_categories:
|
17 |
+
- structure-prediction
|
18 |
+
task_ids:
|
19 |
+
- structure-prediction-other-pos-tagging
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for Arabic POS Dialect
|
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:** https://alt.qcri.org/resources/da_resources/
|
50 |
+
- **Repository:** https://github.com/qcri/dialectal_arabic_resources
|
51 |
+
- **Paper:** http://www.lrec-conf.org/proceedings/lrec2018/pdf/562.pdf
|
52 |
+
- **Contacts:**
|
53 |
+
- Ahmed Abdelali < aabdelali @ hbku dot edu dot qa >
|
54 |
+
- Kareem Darwish < kdarwish @ hbku dot edu dot qa >
|
55 |
+
- Hamdy Mubarak < hmubarak @ hbku dot edu dot qa >
|
56 |
+
|
57 |
+
### Dataset Summary
|
58 |
+
|
59 |
+
This dataset was created to support part of speech (POS) tagging in dialects of Arabic. It contains sets of 350 manually segmented and POS tagged tweets for each of four dialects: Egyptian, Levantine, Gulf, and Maghrebi.
|
60 |
+
|
61 |
+
### Supported Tasks and Leaderboards
|
62 |
+
|
63 |
+
The dataset can be used to train a model for Arabic token segmentation and part of speech tagging in Arabic dialects. Success on this task is typically measured by achieving a high accuracy over a held out dataset. Darwish et al. (2018) train a CRF model across all four dialects and achieve an average accuracy of 89.3%.
|
64 |
+
|
65 |
+
### Languages
|
66 |
+
|
67 |
+
The BCP-47 code is ar-Arab. The dataset consists of four dialects of Arabic, Egyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR), written in Arabic script.
|
68 |
+
|
69 |
+
## Dataset Structure
|
70 |
+
|
71 |
+
### Data Instances
|
72 |
+
|
73 |
+
Below is a partial example from the Egyptian set:
|
74 |
+
```
|
75 |
+
- `Fold`: 4
|
76 |
+
- `SubFold`: A
|
77 |
+
- `Word`: [ليه, لما, تحب, حد, من, قلبك, ...]
|
78 |
+
- `Segmentation`: [ليه, لما, تحب, حد, من, قلب+ك, ...]
|
79 |
+
- `POS`: [PART, PART, V, NOUN, PREP, NOUN+PRON, ...]
|
80 |
+
```
|
81 |
+
|
82 |
+
### Data Fields
|
83 |
+
|
84 |
+
The `fold` and the `subfold` fields refer to the crossfold validation splits used by Darwish et al., which can be generated using this [script](https://github.com/qcri/dialectal_arabic_resources/blob/master/generate_splits.sh).
|
85 |
+
|
86 |
+
- `fold`: An int32 indicating which fold the instance was in for the crossfold validation
|
87 |
+
- `subfold`: A string, either 'A' or 'B', indicating which subfold the instance was in for the crossfold validation
|
88 |
+
- `words`: A sequence of strings of the unsegmented token
|
89 |
+
- `segments`: A sequence of strings consisting of the segments of the word separated by '+' if there is more than one segment
|
90 |
+
- `pos_tags`: A sequence of strings of the part of speech tags of the segments separated by '+' if there is more than one segment
|
91 |
+
|
92 |
+
The POS tags consist of a set developed by [Darwish et al. (2017)](https://www.aclweb.org/anthology/W17-1316.pdf) for Modern Standard Arabic (MSA) plus an additional 6 tags (2 dialect-specific tags and 4 tweet-specific tags).
|
93 |
+
|
94 |
+
| Tag | Purpose | Description |
|
95 |
+
| ----- | ------ | ----- |
|
96 |
+
| ADV | MSA | Adverb |
|
97 |
+
| ADJ | MSA | Adjective |
|
98 |
+
| CONJ | MSA | Conjunction |
|
99 |
+
| DET | MSA | Determiner |
|
100 |
+
| NOUN | MSA | Noun |
|
101 |
+
| NSUFF | MSA | Noun suffix |
|
102 |
+
| NUM | MSA | Number |
|
103 |
+
| PART | MSA | Particle |
|
104 |
+
| PREP | MSA | Preposition |
|
105 |
+
| PRON | MSA | Pronoun |
|
106 |
+
| PUNC | MSA | Preposition |
|
107 |
+
| V | MSA | Verb |
|
108 |
+
| ABBREV | MSA | Abbreviation |
|
109 |
+
| CASE | MSA | Alef of tanween fatha |
|
110 |
+
| JUS | MSA | Jussification attached to verbs |
|
111 |
+
| VSUFF | MSA | Verb Suffix |
|
112 |
+
| FOREIGN | MSA | Non-Arabic as well as non-MSA words |
|
113 |
+
| FUR_PART | MSA | Future particle "s" prefix and "swf" |
|
114 |
+
| PROG_PART | Dialect | Progressive particle |
|
115 |
+
| NEG_PART | Dialect | Negation particle |
|
116 |
+
| HASH | Tweet | Hashtag |
|
117 |
+
| EMOT | Tweet | Emoticon/Emoji |
|
118 |
+
| MENTION | Tweet | Mention |
|
119 |
+
| URL | Tweet | URL |
|
120 |
+
|
121 |
+
### Data Splits
|
122 |
+
|
123 |
+
The dataset is split by dialect.
|
124 |
+
|
125 |
+
| Dialect | Tweets | Words |
|
126 |
+
| ----- | ------ | ----- |
|
127 |
+
| Egyptian (EGY) | 350 | 7481 |
|
128 |
+
| Levantine (LEV) | 350 | 7221 |
|
129 |
+
| Gulf (GLF) | 350 | 6767 |
|
130 |
+
| Maghrebi (MGR) | 350 | 6400 |
|
131 |
+
|
132 |
+
## Dataset Creation
|
133 |
+
|
134 |
+
### Curation Rationale
|
135 |
+
|
136 |
+
This dataset was created to address the lack of computational resources available for dialects of Arabic. These dialects are typically used in speech, while written forms of the language are typically in Modern Standard Arabic. Social media, however, has provided a venue for people to use dialects in written format.
|
137 |
+
|
138 |
+
### Source Data
|
139 |
+
|
140 |
+
This dataset builds off of the work of [Eldesouki et al. (2017)](https://arxiv.org/pdf/1708.05891.pdf) and [Samih et al. (2017b)](https://www.aclweb.org/anthology/K17-1043.pdf) who originally collected the tweets.
|
141 |
+
|
142 |
+
#### Initial Data Collection and Normalization
|
143 |
+
|
144 |
+
They started with 175 million Arabic tweets returned by the Twitter API using the query "lang:ar" in March 2014. They then filtered this set using author-identified locations and tokens that are unique to each dialect. Finally, they had native speakers of each dialect select 350 tweets that were heavily accented.
|
145 |
+
|
146 |
+
#### Who are the source language producers?
|
147 |
+
|
148 |
+
The source language producers are people who posted on Twitter in Arabic using dialectal words from countries where the dialects of interest were spoken, as identified in [Mubarak and Darwish (2014)](https://www.aclweb.org/anthology/W14-3601.pdf).
|
149 |
+
|
150 |
+
### Annotations
|
151 |
+
|
152 |
+
#### Annotation process
|
153 |
+
|
154 |
+
The segmentation guidelines are available at https://alt.qcri.org/resources1/da_resources/seg-guidelines.pdf. The tagging guidelines are not provided, but Darwish at al. note that there were multiple rounds of quality control and revision.
|
155 |
+
|
156 |
+
#### Who are the annotators?
|
157 |
+
|
158 |
+
The POS tags were annotated by native speakers of each dialect. Further information is not known.
|
159 |
+
|
160 |
+
### Personal and Sensitive Information
|
161 |
+
|
162 |
+
[More Information Needed]
|
163 |
+
|
164 |
+
## Considerations for Using the Data
|
165 |
+
|
166 |
+
### Social Impact of Dataset
|
167 |
+
|
168 |
+
Darwish et al find that the accuracy on the Maghrebi dataset suffered the most when the training set was from another dialect, and conversely training on Maghrebi yielded the worst results for all the other dialects. They suggest that Egyptian, Levantine, and Gulf may be more similar to each other and Maghrebi the most dissimilar to all of them. They also find that training on Modern Standard Arabic (MSA) and testing on dialects yielded significantly lower results compared to training on dialects and testing on MSA. This suggests that dialectal variation should be a significant consideration for future work in Arabic NLP applications, particularly when working with social media text.
|
169 |
+
|
170 |
+
### Discussion of Biases
|
171 |
+
|
172 |
+
[More Information Needed]
|
173 |
+
|
174 |
+
### Other Known Limitations
|
175 |
+
|
176 |
+
[More Information Needed]
|
177 |
+
|
178 |
+
## Additional Information
|
179 |
+
|
180 |
+
### Dataset Curators
|
181 |
+
|
182 |
+
This dataset was curated by Kareem Darwish, Hamdy Mubarak, Mohamed Eldesouki and Ahmed Abdelali with the Qatar Computing Research Institute (QCRI), Younes Samih and Laura Kallmeyer with the University of Dusseldorf, Randah Alharbi and Walid Magdy with the University of Edinburgh, and Mohammed Attia with Google. No funding information was included.
|
183 |
+
|
184 |
+
### Licensing Information
|
185 |
+
|
186 |
+
This dataset is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
187 |
+
|
188 |
+
### Citation Information
|
189 |
+
|
190 |
+
Kareem Darwish, Hamdy Mubarak, Ahmed Abdelali, Mohamed Eldesouki, Younes Samih, Randah Alharbi, Mohammed Attia, Walid Magdy and Laura Kallmeyer (2018) Multi-Dialect Arabic POS Tagging: A CRF Approach. Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), May 7-12, 2018. Miyazaki, Japan.
|
191 |
+
|
192 |
+
```
|
193 |
+
@InProceedings{DARWISH18.562,
|
194 |
+
author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},
|
195 |
+
title = {Multi-Dialect Arabic POS Tagging: A CRF Approach},
|
196 |
+
booktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
|
197 |
+
year = {2018},
|
198 |
+
month = {may},
|
199 |
+
date = {7-12},
|
200 |
+
location = {Miyazaki, Japan},
|
201 |
+
editor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and Hélène Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},
|
202 |
+
publisher = {European Language Resources Association (ELRA)},
|
203 |
+
address = {Paris, France},
|
204 |
+
isbn = {979-10-95546-00-9},
|
205 |
+
language = {english}
|
206 |
+
}
|
207 |
+
```
|
arabic_pos_dialect.py
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""TODO: Add a description here."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """
|
25 |
+
@InProceedings{DARWISH18.562, author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},
|
26 |
+
title = {Multi-Dialect Arabic POS Tagging: A CRF Approach},
|
27 |
+
booktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},
|
28 |
+
year = {2018},
|
29 |
+
month = {may},
|
30 |
+
date = {7-12},
|
31 |
+
location = {Miyazaki, Japan},
|
32 |
+
editor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and Hélène Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},
|
33 |
+
publisher = {European Language Resources Association (ELRA)},
|
34 |
+
address = {Paris, France},
|
35 |
+
isbn = {979-10-95546-00-9},
|
36 |
+
language = {english}
|
37 |
+
}
|
38 |
+
"""
|
39 |
+
|
40 |
+
_DESCRIPTION = """\
|
41 |
+
The Dialectal Arabic Datasets contain four dialects of Arabic, Etyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR). Each dataset consists of a set of 350 manually segmented and POS tagged tweets.
|
42 |
+
"""
|
43 |
+
|
44 |
+
_URL = "https://github.com/qcri/dialectal_arabic_resources/raw/master/"
|
45 |
+
_DIALECTS = ["egy", "lev", "glf", "mgr"]
|
46 |
+
|
47 |
+
|
48 |
+
class ArabicPosDialectConfig(datasets.BuilderConfig):
|
49 |
+
""" BuilderConfig for ArabicPosDialect"""
|
50 |
+
|
51 |
+
def __init__(self, dialect=None, **kwargs):
|
52 |
+
"""
|
53 |
+
|
54 |
+
Args:
|
55 |
+
dialect: the 3-letter code string of the dialect set that will be used.
|
56 |
+
Code should be one of the following: egy, lev, glf, mgr.
|
57 |
+
**kwargs: keyword arguments forwarded to super.
|
58 |
+
"""
|
59 |
+
super(ArabicPosDialectConfig, self).__init__(**kwargs)
|
60 |
+
assert dialect in _DIALECTS, ("Invalid dialect code: %s", dialect)
|
61 |
+
self.dialect = dialect
|
62 |
+
|
63 |
+
|
64 |
+
class ArabicPosDialect(datasets.GeneratorBasedBuilder):
|
65 |
+
"""POS-tagged Arabic tweets in four major dialects."""
|
66 |
+
|
67 |
+
VERSION = datasets.Version("1.1.0")
|
68 |
+
BUILDER_CONFIG_CLASS = ArabicPosDialectConfig
|
69 |
+
BUILDER_CONFIGS = [
|
70 |
+
ArabicPosDialectConfig(
|
71 |
+
name=dialect,
|
72 |
+
dialect=dialect,
|
73 |
+
description="A set of 350 tweets in the {} dialect of Arabic that have been manually segmented and POS tagged.".format(
|
74 |
+
dialect
|
75 |
+
),
|
76 |
+
)
|
77 |
+
for dialect in _DIALECTS
|
78 |
+
]
|
79 |
+
|
80 |
+
def _info(self):
|
81 |
+
return datasets.DatasetInfo(
|
82 |
+
description=_DESCRIPTION,
|
83 |
+
features=datasets.Features(
|
84 |
+
{
|
85 |
+
"fold": datasets.Value("int32"),
|
86 |
+
"subfold": datasets.Value("string"),
|
87 |
+
"words": datasets.Sequence(datasets.Value("string")),
|
88 |
+
"segments": datasets.Sequence(datasets.Value("string")),
|
89 |
+
"pos_tags": datasets.Sequence(datasets.Value("string")),
|
90 |
+
}
|
91 |
+
),
|
92 |
+
# If there's a common (input, target) tuple from the features,
|
93 |
+
# specify them here. They'll be used if as_supervised=True in
|
94 |
+
# builder.as_dataset.
|
95 |
+
supervised_keys=None,
|
96 |
+
homepage="https://alt.qcri.org/resources/da_resources/",
|
97 |
+
citation=_CITATION,
|
98 |
+
)
|
99 |
+
|
100 |
+
def _split_generators(self, dl_manager):
|
101 |
+
"""Returns SplitGenerators."""
|
102 |
+
# TODO: Downloads the data and defines the splits
|
103 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to
|
104 |
+
# download and extract URLs
|
105 |
+
urls_to_download = {dialect: _URL + "seg_plus_pos_{}.txt".format(dialect) for dialect in _DIALECTS}
|
106 |
+
dl_dir = dl_manager.download_and_extract(urls_to_download)
|
107 |
+
return [
|
108 |
+
datasets.SplitGenerator(
|
109 |
+
name=datasets.Split.TRAIN,
|
110 |
+
# These kwargs will be passed to _generate_examples
|
111 |
+
gen_kwargs={"filepath": dl_dir[self.config.dialect]},
|
112 |
+
)
|
113 |
+
]
|
114 |
+
|
115 |
+
def _generate_examples(self, filepath):
|
116 |
+
""" Yields examples in the raw (text) form. """
|
117 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
118 |
+
reader = csv.DictReader(csv_file, delimiter="\t", quoting=csv.QUOTE_NONE)
|
119 |
+
fold = -1
|
120 |
+
subfold = ""
|
121 |
+
words = []
|
122 |
+
segments = []
|
123 |
+
pos_tags = []
|
124 |
+
curr_sent = -1
|
125 |
+
for idx, row in enumerate(reader):
|
126 |
+
# first example
|
127 |
+
if fold == -1:
|
128 |
+
fold = row["Fold"]
|
129 |
+
subfold = row["SubFold"]
|
130 |
+
curr_sent = int(row["SentID"])
|
131 |
+
if int(row["SentID"]) != curr_sent:
|
132 |
+
yield curr_sent, {
|
133 |
+
"fold": fold,
|
134 |
+
"subfold": subfold,
|
135 |
+
"words": words,
|
136 |
+
"segments": segments,
|
137 |
+
"pos_tags": pos_tags,
|
138 |
+
}
|
139 |
+
fold = row["Fold"]
|
140 |
+
subfold = row["SubFold"]
|
141 |
+
words = [row["Word"]]
|
142 |
+
segments = [row["Segmentation"]]
|
143 |
+
pos_tags = [row["POS"]]
|
144 |
+
curr_sent = int(row["SentID"])
|
145 |
+
else:
|
146 |
+
words.append(row["Word"])
|
147 |
+
segments.append(row["Segmentation"])
|
148 |
+
pos_tags.append(row["POS"])
|
149 |
+
# last example
|
150 |
+
yield curr_sent, {
|
151 |
+
"fold": fold,
|
152 |
+
"subfold": subfold,
|
153 |
+
"words": words,
|
154 |
+
"segments": segments,
|
155 |
+
"pos_tags": pos_tags,
|
156 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"egy": {"description": "The Dialectal Arabic Datasets contain four dialects of Arabic, Etyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR). Each dataset consists of a set of 350 manually segmented and POS tagged tweets.\n", "citation": "\n@InProceedings{DARWISH18.562, author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},\ntitle = {Multi-Dialect Arabic POS Tagging: A CRF Approach},\nbooktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},\nyear = {2018},\nmonth = {may},\ndate = {7-12},\nlocation = {Miyazaki, Japan},\neditor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and H\u00e9l\u00e8ne Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},\npublisher = {European Language Resources Association (ELRA)},\naddress = {Paris, France},\nisbn = {979-10-95546-00-9},\nlanguage = {english}\n}\n", "homepage": "https://alt.qcri.org/resources/da_resources/", "license": "", "features": {"fold": {"dtype": "int32", "id": null, "_type": "Value"}, "subfold": {"dtype": "string", "id": null, "_type": "Value"}, "words": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "arabic_pos_dialect", "config_name": "egy", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 269657, "num_examples": 350, "dataset_name": "arabic_pos_dialect"}}, "download_checksums": {"https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_egy.txt": {"num_bytes": 290070, "checksum": "13977060df1266eb5084c724b0109ec946a12304d24bf18810bc2e662146dfd5"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_lev.txt": {"num_bytes": 265356, "checksum": "dd6741ab80a605b290dd0c82c7b20670b4ecc8ae982d9762660266c7fd4c0036"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_glf.txt": {"num_bytes": 241428, "checksum": "a719b071806ae9398182817aef87abd240393fbc2f98b24361a94f219c3daa31"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_mgr.txt": {"num_bytes": 246801, "checksum": "86ca158dc5981a84d25078a2063e8e081ecca7d5437f49b63b4ebd531042476a"}}, "download_size": 1043655, "post_processing_size": null, "dataset_size": 269657, "size_in_bytes": 1313312}, "lev": {"description": "The Dialectal Arabic Datasets contain four dialects of Arabic, Etyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR). Each dataset consists of a set of 350 manually segmented and POS tagged tweets.\n", "citation": "\n@InProceedings{DARWISH18.562, author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},\ntitle = {Multi-Dialect Arabic POS Tagging: A CRF Approach},\nbooktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},\nyear = {2018},\nmonth = {may},\ndate = {7-12},\nlocation = {Miyazaki, Japan},\neditor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and H\u00e9l\u00e8ne Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},\npublisher = {European Language Resources Association (ELRA)},\naddress = {Paris, France},\nisbn = {979-10-95546-00-9},\nlanguage = {english}\n}\n", "homepage": "https://alt.qcri.org/resources/da_resources/", "license": "", "features": {"fold": {"dtype": "int32", "id": null, "_type": "Value"}, "subfold": {"dtype": "string", "id": null, "_type": "Value"}, "words": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "arabic_pos_dialect", "config_name": "lev", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 263130, "num_examples": 350, "dataset_name": "arabic_pos_dialect"}}, "download_checksums": {"https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_egy.txt": {"num_bytes": 290070, "checksum": "13977060df1266eb5084c724b0109ec946a12304d24bf18810bc2e662146dfd5"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_lev.txt": {"num_bytes": 265356, "checksum": "dd6741ab80a605b290dd0c82c7b20670b4ecc8ae982d9762660266c7fd4c0036"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_glf.txt": {"num_bytes": 241428, "checksum": "a719b071806ae9398182817aef87abd240393fbc2f98b24361a94f219c3daa31"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_mgr.txt": {"num_bytes": 246801, "checksum": "86ca158dc5981a84d25078a2063e8e081ecca7d5437f49b63b4ebd531042476a"}}, "download_size": 1043655, "post_processing_size": null, "dataset_size": 263130, "size_in_bytes": 1306785}, "glf": {"description": "The Dialectal Arabic Datasets contain four dialects of Arabic, Etyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR). Each dataset consists of a set of 350 manually segmented and POS tagged tweets.\n", "citation": "\n@InProceedings{DARWISH18.562, author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},\ntitle = {Multi-Dialect Arabic POS Tagging: A CRF Approach},\nbooktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},\nyear = {2018},\nmonth = {may},\ndate = {7-12},\nlocation = {Miyazaki, Japan},\neditor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and H\u00e9l\u00e8ne Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},\npublisher = {European Language Resources Association (ELRA)},\naddress = {Paris, France},\nisbn = {979-10-95546-00-9},\nlanguage = {english}\n}\n", "homepage": "https://alt.qcri.org/resources/da_resources/", "license": "", "features": {"fold": {"dtype": "int32", "id": null, "_type": "Value"}, "subfold": {"dtype": "string", "id": null, "_type": "Value"}, "words": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "arabic_pos_dialect", "config_name": "glf", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 239911, "num_examples": 350, "dataset_name": "arabic_pos_dialect"}}, "download_checksums": {"https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_egy.txt": {"num_bytes": 290070, "checksum": "13977060df1266eb5084c724b0109ec946a12304d24bf18810bc2e662146dfd5"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_lev.txt": {"num_bytes": 265356, "checksum": "dd6741ab80a605b290dd0c82c7b20670b4ecc8ae982d9762660266c7fd4c0036"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_glf.txt": {"num_bytes": 241428, "checksum": "a719b071806ae9398182817aef87abd240393fbc2f98b24361a94f219c3daa31"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_mgr.txt": {"num_bytes": 246801, "checksum": "86ca158dc5981a84d25078a2063e8e081ecca7d5437f49b63b4ebd531042476a"}}, "download_size": 1043655, "post_processing_size": null, "dataset_size": 239911, "size_in_bytes": 1283566}, "mgr": {"description": "The Dialectal Arabic Datasets contain four dialects of Arabic, Etyptian (EGY), Levantine (LEV), Gulf (GLF), and Maghrebi (MGR). Each dataset consists of a set of 350 manually segmented and POS tagged tweets.\n", "citation": "\n@InProceedings{DARWISH18.562, author = {Kareem Darwish ,Hamdy Mubarak ,Ahmed Abdelali ,Mohamed Eldesouki ,Younes Samih ,Randah Alharbi ,Mohammed Attia ,Walid Magdy and Laura Kallmeyer},\ntitle = {Multi-Dialect Arabic POS Tagging: A CRF Approach},\nbooktitle = {Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018)},\nyear = {2018},\nmonth = {may},\ndate = {7-12},\nlocation = {Miyazaki, Japan},\neditor = {Nicoletta Calzolari (Conference chair) and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaard and Joseph Mariani and H\u00e9l\u00e8ne Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},\npublisher = {European Language Resources Association (ELRA)},\naddress = {Paris, France},\nisbn = {979-10-95546-00-9},\nlanguage = {english}\n}\n", "homepage": "https://alt.qcri.org/resources/da_resources/", "license": "", "features": {"fold": {"dtype": "int32", "id": null, "_type": "Value"}, "subfold": {"dtype": "string", "id": null, "_type": "Value"}, "words": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "segments": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "pos_tags": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "arabic_pos_dialect", "config_name": "mgr", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 245745, "num_examples": 350, "dataset_name": "arabic_pos_dialect"}}, "download_checksums": {"https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_egy.txt": {"num_bytes": 290070, "checksum": "13977060df1266eb5084c724b0109ec946a12304d24bf18810bc2e662146dfd5"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_lev.txt": {"num_bytes": 265356, "checksum": "dd6741ab80a605b290dd0c82c7b20670b4ecc8ae982d9762660266c7fd4c0036"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_glf.txt": {"num_bytes": 241428, "checksum": "a719b071806ae9398182817aef87abd240393fbc2f98b24361a94f219c3daa31"}, "https://github.com/qcri/dialectal_arabic_resources/raw/master/seg_plus_pos_mgr.txt": {"num_bytes": 246801, "checksum": "86ca158dc5981a84d25078a2063e8e081ecca7d5437f49b63b4ebd531042476a"}}, "download_size": 1043655, "post_processing_size": null, "dataset_size": 245745, "size_in_bytes": 1289400}}
|
dummy/egy/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5784f006f6039516ed70ea733276f0db79c87c29c1c866389d726724a5d9a989
|
3 |
+
size 1120
|
dummy/glf/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff3dbc5caa25698e5b6c65f7547fb2252cd6e3ca4336b85b504c9e58f17bbb1b
|
3 |
+
size 1120
|
dummy/lev/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7afd690cdcbfe518cbf2929bdd9bf7a142587793b1e7ab5ff93752f58b8645f6
|
3 |
+
size 1120
|
dummy/mgr/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:30e53e7c7a1eea2730f19205f90e6e7904991882a2ffea2821a9b03c91a6bb21
|
3 |
+
size 1120
|