Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Languages:
Arabic
Size:
10K - 100K
Tags:
poetry-classification
License:
Commit
•
56ec8d0
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 +152 -0
- dataset_infos.json +1 -0
- dummy/plain_text/1.0.0/dummy_data.zip +3 -0
- metrec.py +123 -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,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- no-annotation
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- ar
|
8 |
+
licenses:
|
9 |
+
- unknown
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10k<n<100k
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
task_ids:
|
19 |
+
- text-classification-other-poetry-classification
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for MetRec
|
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 |
+
- [Discussion of Social Impact and Biases](#discussion-of-social-impact-and-biases)
|
40 |
+
- [Other Known Limitations](#other-known-limitations)
|
41 |
+
- [Additional Information](#additional-information)
|
42 |
+
- [Dataset Curators](#dataset-curators)
|
43 |
+
- [Licensing Information](#licensing-information)
|
44 |
+
- [Citation Information](#citation-information)
|
45 |
+
|
46 |
+
## Dataset Description
|
47 |
+
|
48 |
+
- **Homepage:** [Metrec](https://github.com/zaidalyafeai/MetRec)
|
49 |
+
- **Repository:** [Metrec repository](https://github.com/zaidalyafeai/MetRec)
|
50 |
+
- **Paper:** [MetRec: A dataset for meter classification of arabic poetry](https://www.sciencedirect.com/science/article/pii/S2352340920313792)
|
51 |
+
- **Point of Contact:** [Zaid Alyafeai](mailto:alyafey22@gmail.com)
|
52 |
+
|
53 |
+
### Dataset Summary
|
54 |
+
|
55 |
+
The dataset contains the verses and their corresponding meter classes.
|
56 |
+
Meter classes are represented as numbers from 0 to 13.
|
57 |
+
The dataset can be highly useful for further research in order to improve the field of Arabic poems’ meter classification.
|
58 |
+
The train dataset contains 47,124 records and the test dataset contains 8,316 records.
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
The dataset was published on this [paper](https://www.sciencedirect.com/science/article/pii/S2352340920313792). A benchmark is acheived on this [paper](https://www.sciencedirect.com/science/article/pii/S016786552030204X).
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
The dataset is based on Arabic.
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
A typical data point comprises a label which is out of 13 classes and a verse part of poem.
|
73 |
+
|
74 |
+
### Data Fields
|
75 |
+
|
76 |
+
[N/A]
|
77 |
+
|
78 |
+
### Data Splits
|
79 |
+
|
80 |
+
The data is split into a training and testing. The split is organized as the following
|
81 |
+
|
82 |
+
| | Tain | Test |
|
83 |
+
|---------- | ------ | ---- |
|
84 |
+
|data split | 47,124 | 8,316|
|
85 |
+
|
86 |
+
## Dataset Creation
|
87 |
+
|
88 |
+
### Curation Rationale
|
89 |
+
|
90 |
+
[More Information Needed]
|
91 |
+
|
92 |
+
### Source Data
|
93 |
+
|
94 |
+
[More Information Needed]
|
95 |
+
|
96 |
+
#### Initial Data Collection and Normalization
|
97 |
+
|
98 |
+
The dataset was collected from [Aldiwan](https://www.aldiwan.net/).
|
99 |
+
|
100 |
+
#### Who are the source language producers?
|
101 |
+
|
102 |
+
The poems are from different poets.
|
103 |
+
|
104 |
+
### Annotations
|
105 |
+
|
106 |
+
The dataset does not contain any additional annotations.
|
107 |
+
|
108 |
+
#### Annotation process
|
109 |
+
|
110 |
+
[More Information Needed]
|
111 |
+
|
112 |
+
#### Who are the annotators?
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
### Personal and Sensitive Information
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
## Considerations for Using the Data
|
121 |
+
|
122 |
+
### Discussion of Social Impact and Biases
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
### Other Known Limitations
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
## Additional Information
|
131 |
+
|
132 |
+
### Dataset Curators
|
133 |
+
|
134 |
+
[More Information Needed]
|
135 |
+
|
136 |
+
### Licensing Information
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Citation Information
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
```
|
145 |
+
@article{metrec2020,
|
146 |
+
title={MetRec: A dataset for meter classification of arabic poetry},
|
147 |
+
author={Al-shaibani, Maged S and Alyafeai, Zaid and Ahmad, Irfan},
|
148 |
+
journal={Data in Brief},
|
149 |
+
year={2020},
|
150 |
+
publisher={Elsevier}
|
151 |
+
}
|
152 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"plain_text": {"description": "Arabic Poetry Metric Classification.\nThe dataset contains the verses and their corresponding meter classes.Meter classes are represented as numbers from 0 to 13. The dataset can be highly useful for further research in order to improve the field of Arabic poems\u2019 meter classification.The train dataset contains 47,124 records and the test dataset contains 8316 records.\n", "citation": "@article{al2020meter,\n title={Meter Classification of Arabic Poems Using Deep Bidirectional Recurrent Neural Networks},\n author={Al-shaibani, Maged S and Alyafeai, Zaid and Ahmad, Irfan},\n journal={Pattern Recognition Letters},\n year={2020},\n publisher={Elsevier}\n}\n", "homepage": "https://github.com/zaidalyafeai/MetRec", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 14, "names": ["saree", "kamel", "mutakareb", "mutadarak", "munsareh", "madeed", "mujtath", "ramal", "baseet", "khafeef", "taweel", "wafer", "hazaj", "rajaz"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "metrec", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5874919, "num_examples": 47124, "dataset_name": "metrec"}, "test": {"name": "test", "num_bytes": 1037577, "num_examples": 8316, "dataset_name": "metrec"}}, "download_checksums": {"https://raw.githubusercontent.com/zaidalyafeai/MetRec/master/baits.zip": {"num_bytes": 2267882, "checksum": "558ac80e54a9111f9d784e898526ce8bc831d06aafd2110cb2acd216a667dbf7"}}, "download_size": 2267882, "post_processing_size": null, "dataset_size": 6912496, "size_in_bytes": 9180378}}
|
dummy/plain_text/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1fa11200c88b247c02b5c3009e4d609f8696cda6de64cffe1448fecee8d3ae1d
|
3 |
+
size 865
|
metrec.py
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The TensorFlow Datasets Authors and the 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 |
+
"""Arabic Poetry Metric dataset."""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import os
|
22 |
+
|
23 |
+
import datasets
|
24 |
+
|
25 |
+
|
26 |
+
_DESCRIPTION = """\
|
27 |
+
Arabic Poetry Metric Classification.
|
28 |
+
The dataset contains the verses and their corresponding meter classes.\
|
29 |
+
Meter classes are represented as numbers from 0 to 13. \
|
30 |
+
The dataset can be highly useful for further research in order to improve the field of Arabic poems’ meter classification.\
|
31 |
+
The train dataset contains 47,124 records and the test dataset contains 8316 records.
|
32 |
+
"""
|
33 |
+
|
34 |
+
_CITATION = """\
|
35 |
+
@article{metrec2020,
|
36 |
+
title={MetRec: A dataset for meter classification of arabic poetry},
|
37 |
+
author={Al-shaibani, Maged S and Alyafeai, Zaid and Ahmad, Irfan},
|
38 |
+
journal={Data in Brief},
|
39 |
+
year={2020},
|
40 |
+
publisher={Elsevier}
|
41 |
+
}
|
42 |
+
"""
|
43 |
+
|
44 |
+
_DOWNLOAD_URL = "https://raw.githubusercontent.com/zaidalyafeai/MetRec/master/baits.zip"
|
45 |
+
|
46 |
+
|
47 |
+
class MetRecConfig(datasets.BuilderConfig):
|
48 |
+
"""BuilderConfig for MetRec."""
|
49 |
+
|
50 |
+
def __init__(self, **kwargs):
|
51 |
+
"""BuilderConfig for MetRec.
|
52 |
+
|
53 |
+
Args:
|
54 |
+
**kwargs: keyword arguments forwarded to super.
|
55 |
+
"""
|
56 |
+
super(MetRecConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
57 |
+
|
58 |
+
|
59 |
+
class Metrec(datasets.GeneratorBasedBuilder):
|
60 |
+
"""Metrec dataset."""
|
61 |
+
|
62 |
+
BUILDER_CONFIGS = [
|
63 |
+
MetRecConfig(
|
64 |
+
name="plain_text",
|
65 |
+
description="Plain text",
|
66 |
+
)
|
67 |
+
]
|
68 |
+
|
69 |
+
def _info(self):
|
70 |
+
return datasets.DatasetInfo(
|
71 |
+
description=_DESCRIPTION,
|
72 |
+
features=datasets.Features(
|
73 |
+
{
|
74 |
+
"text": datasets.Value("string"),
|
75 |
+
"label": datasets.features.ClassLabel(
|
76 |
+
names=[
|
77 |
+
"saree",
|
78 |
+
"kamel",
|
79 |
+
"mutakareb",
|
80 |
+
"mutadarak",
|
81 |
+
"munsareh",
|
82 |
+
"madeed",
|
83 |
+
"mujtath",
|
84 |
+
"ramal",
|
85 |
+
"baseet",
|
86 |
+
"khafeef",
|
87 |
+
"taweel",
|
88 |
+
"wafer",
|
89 |
+
"hazaj",
|
90 |
+
"rajaz",
|
91 |
+
]
|
92 |
+
),
|
93 |
+
}
|
94 |
+
),
|
95 |
+
supervised_keys=None,
|
96 |
+
homepage="https://github.com/zaidalyafeai/MetRec",
|
97 |
+
citation=_CITATION,
|
98 |
+
)
|
99 |
+
|
100 |
+
def _vocab_text_gen(self, archive):
|
101 |
+
for _, ex in self._generate_examples(archive, os.path.join("final_baits", "train.txt")):
|
102 |
+
yield ex["text"]
|
103 |
+
|
104 |
+
def _split_generators(self, dl_manager):
|
105 |
+
arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL)
|
106 |
+
data_dir = os.path.join(arch_path, "final_baits")
|
107 |
+
return [
|
108 |
+
datasets.SplitGenerator(
|
109 |
+
name=datasets.Split.TRAIN, gen_kwargs={"directory": os.path.join(data_dir, "train.txt")}
|
110 |
+
),
|
111 |
+
datasets.SplitGenerator(
|
112 |
+
name=datasets.Split.TEST, gen_kwargs={"directory": os.path.join(data_dir, "test.txt")}
|
113 |
+
),
|
114 |
+
]
|
115 |
+
|
116 |
+
def _generate_examples(self, directory, labeled=True):
|
117 |
+
"""Generate examples."""
|
118 |
+
# For labeled examples, extract the label from the path.
|
119 |
+
|
120 |
+
with open(directory, encoding="UTF-8") as f:
|
121 |
+
for id_, record in enumerate(f.read().splitlines()):
|
122 |
+
label, bait = record.split(" ", 1)
|
123 |
+
yield str(id_), {"text": bait, "label": int(label)}
|