Convert dataset to Parquet
#2
by
albertvillanova
HF Staff
- opened
- README.md +12 -7
- plain_text/train-00000-of-00003.parquet +3 -0
- plain_text/train-00001-of-00003.parquet +3 -0
- plain_text/train-00002-of-00003.parquet +3 -0
- tashkeela.py +0 -104
README.md
CHANGED
|
@@ -19,23 +19,28 @@ task_categories:
|
|
| 19 |
task_ids:
|
| 20 |
- language-modeling
|
| 21 |
- masked-language-modeling
|
| 22 |
-
paperswithcode_id: null
|
| 23 |
pretty_name: Tashkeela
|
| 24 |
tags:
|
| 25 |
- diacritics-prediction
|
| 26 |
dataset_info:
|
|
|
|
| 27 |
features:
|
| 28 |
-
- name: text
|
| 29 |
-
dtype: string
|
| 30 |
- name: book
|
| 31 |
dtype: string
|
| 32 |
-
|
|
|
|
| 33 |
splits:
|
| 34 |
- name: train
|
| 35 |
-
num_bytes:
|
| 36 |
num_examples: 97
|
| 37 |
-
download_size:
|
| 38 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
---
|
| 40 |
|
| 41 |
# Dataset Card for Tashkeela
|
|
|
|
| 19 |
task_ids:
|
| 20 |
- language-modeling
|
| 21 |
- masked-language-modeling
|
|
|
|
| 22 |
pretty_name: Tashkeela
|
| 23 |
tags:
|
| 24 |
- diacritics-prediction
|
| 25 |
dataset_info:
|
| 26 |
+
config_name: plain_text
|
| 27 |
features:
|
|
|
|
|
|
|
| 28 |
- name: book
|
| 29 |
dtype: string
|
| 30 |
+
- name: text
|
| 31 |
+
dtype: string
|
| 32 |
splits:
|
| 33 |
- name: train
|
| 34 |
+
num_bytes: 1081110229
|
| 35 |
num_examples: 97
|
| 36 |
+
download_size: 420434207
|
| 37 |
+
dataset_size: 1081110229
|
| 38 |
+
configs:
|
| 39 |
+
- config_name: plain_text
|
| 40 |
+
data_files:
|
| 41 |
+
- split: train
|
| 42 |
+
path: plain_text/train-*
|
| 43 |
+
default: true
|
| 44 |
---
|
| 45 |
|
| 46 |
# Dataset Card for Tashkeela
|
plain_text/train-00000-of-00003.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7b5cc918e9b1e09060e5eca812dd44efa73d9682da997b03f4364d13031fe31
|
| 3 |
+
size 138891011
|
plain_text/train-00001-of-00003.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c72edc5cb177e8a00059db6d173b4a54faf94f27908b23e42f3d0caa9251fd3
|
| 3 |
+
size 180319094
|
plain_text/train-00002-of-00003.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:991556a9e4165089f1c0ae13e229573434a6603c260ff4bf3c9e4e0eb094ea2c
|
| 3 |
+
size 101224102
|
tashkeela.py
DELETED
|
@@ -1,104 +0,0 @@
|
|
| 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 Vocalized Words Dataset."""
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
import glob
|
| 21 |
-
import os
|
| 22 |
-
|
| 23 |
-
import datasets
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
_DESCRIPTION = """\
|
| 27 |
-
Arabic vocalized texts.
|
| 28 |
-
it contains 75 million of fully vocalized words mainly\
|
| 29 |
-
97 books from classical and modern Arabic language.
|
| 30 |
-
"""
|
| 31 |
-
|
| 32 |
-
_CITATION = """\
|
| 33 |
-
@article{zerrouki2017tashkeela,
|
| 34 |
-
title={Tashkeela: Novel corpus of Arabic vocalized texts, data for auto-diacritization systems},
|
| 35 |
-
author={Zerrouki, Taha and Balla, Amar},
|
| 36 |
-
journal={Data in brief},
|
| 37 |
-
volume={11},
|
| 38 |
-
pages={147},
|
| 39 |
-
year={2017},
|
| 40 |
-
publisher={Elsevier}
|
| 41 |
-
}
|
| 42 |
-
"""
|
| 43 |
-
|
| 44 |
-
_HOMEPAGE = "https://sourceforge.net/projects/tashkeela/"
|
| 45 |
-
|
| 46 |
-
_LICENSE = "GPLv2"
|
| 47 |
-
|
| 48 |
-
_DOWNLOAD_URL = "https://sourceforge.net/projects/tashkeela/files/latest/download"
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
class TashkeelaConfig(datasets.BuilderConfig):
|
| 52 |
-
"""BuilderConfig for Tashkeela."""
|
| 53 |
-
|
| 54 |
-
def __init__(self, **kwargs):
|
| 55 |
-
"""BuilderConfig for Tashkeela.
|
| 56 |
-
|
| 57 |
-
Args:
|
| 58 |
-
**kwargs: keyword arguments forwarded to super.
|
| 59 |
-
"""
|
| 60 |
-
super(TashkeelaConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class Tashkeela(datasets.GeneratorBasedBuilder):
|
| 64 |
-
"""Tashkeela dataset."""
|
| 65 |
-
|
| 66 |
-
BUILDER_CONFIGS = [
|
| 67 |
-
TashkeelaConfig(
|
| 68 |
-
name="plain_text",
|
| 69 |
-
description="Plain text",
|
| 70 |
-
)
|
| 71 |
-
]
|
| 72 |
-
|
| 73 |
-
def _info(self):
|
| 74 |
-
return datasets.DatasetInfo(
|
| 75 |
-
description=_DESCRIPTION,
|
| 76 |
-
features=datasets.Features(
|
| 77 |
-
{
|
| 78 |
-
"book": datasets.Value("string"),
|
| 79 |
-
"text": datasets.Value("string"),
|
| 80 |
-
}
|
| 81 |
-
),
|
| 82 |
-
supervised_keys=None,
|
| 83 |
-
homepage=_HOMEPAGE,
|
| 84 |
-
license=_LICENSE,
|
| 85 |
-
citation=_CITATION,
|
| 86 |
-
)
|
| 87 |
-
|
| 88 |
-
def _split_generators(self, dl_manager):
|
| 89 |
-
arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL)
|
| 90 |
-
return [
|
| 91 |
-
datasets.SplitGenerator(
|
| 92 |
-
name=datasets.Split.TRAIN,
|
| 93 |
-
gen_kwargs={
|
| 94 |
-
"directory": os.path.join(arch_path, "Tashkeela-arabic-diacritized-text-utf8-0.3", "texts.txt")
|
| 95 |
-
},
|
| 96 |
-
),
|
| 97 |
-
]
|
| 98 |
-
|
| 99 |
-
def _generate_examples(self, directory):
|
| 100 |
-
"""Generate examples."""
|
| 101 |
-
|
| 102 |
-
for id_, file_name in enumerate(sorted(glob.glob(os.path.join(directory, "**.txt")))):
|
| 103 |
-
with open(file_name, encoding="UTF-8") as f:
|
| 104 |
-
yield str(id_), {"book": file_name, "text": f.read().strip()}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|