Update arabic_billion_words.py
Browse files- arabic_billion_words.py +16 -19
arabic_billion_words.py
CHANGED
@@ -40,22 +40,19 @@ Also it was marked with two mark-up languages, namely: SGML, and XML.
|
|
40 |
|
41 |
_HOMEPAGE = "https://huggingface.co/datasets/arabic_billion_words"
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
"
|
50 |
-
"
|
51 |
-
"
|
52 |
-
"
|
53 |
-
"
|
54 |
-
"
|
55 |
-
"
|
56 |
-
"SaudiYoum": _BASE_PATH / "SaudiYoum_XML_utf_8.rar",
|
57 |
-
"Techreen": _BASE_PATH / "Techreen_XML_utf_8.rar",
|
58 |
-
"Youm7": _BASE_PATH / "Youm7_XML_utf_8.rar",
|
59 |
}
|
60 |
|
61 |
# Some tags are misspelled
|
@@ -131,8 +128,8 @@ class ArabicBillionWords(datasets.GeneratorBasedBuilder):
|
|
131 |
|
132 |
def _split_generators(self, dl_manager):
|
133 |
"""Returns SplitGenerators."""
|
134 |
-
|
135 |
-
data_dir = dl_manager.
|
136 |
my_file_name = f"{self.config.name}_utf_8.xml"
|
137 |
return [
|
138 |
datasets.SplitGenerator(
|
@@ -175,4 +172,4 @@ class ArabicBillionWords(datasets.GeneratorBasedBuilder):
|
|
175 |
|
176 |
@staticmethod
|
177 |
def _clean_text(text):
|
178 |
-
return text.replace("?", "")
|
|
|
40 |
|
41 |
_HOMEPAGE = "https://huggingface.co/datasets/arabic_billion_words"
|
42 |
|
43 |
+
|
44 |
+
_URL = "https://huggingface.co/datasets/oserikov/arabic_billion_words/resolve/main/dataset/new_data_"
|
45 |
+
_URLs = {
|
46 |
+
"Alittihad": _URL + "Alittihad_XML_utf_8.rar",
|
47 |
+
"Almasryalyoum": _URL + "Almasryalyoum_XML_utf_8.rar",
|
48 |
+
"Almustaqbal": _URL + "Almustaqbal_XML_utf_8.rar",
|
49 |
+
"Alqabas": _URL + "Alqabas_XML_utf_8.rar",
|
50 |
+
"Echoroukonline": _URL + "Echoroukonline_XML_utf_8.rar",
|
51 |
+
"Ryiadh": _URL + "Ryiadh_XML_utf_8.rar",
|
52 |
+
"Sabanews": _URL + "Sabanews_XML_utf_8.rar",
|
53 |
+
"SaudiYoum": _URL + "SaudiYoum_XML_utf_8.rar",
|
54 |
+
"Techreen": _URL + "Techreen_XML_utf_8.rar",
|
55 |
+
"Youm7": _URL + "Youm7_XML_utf_8.rar",
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
# Some tags are misspelled
|
|
|
128 |
|
129 |
def _split_generators(self, dl_manager):
|
130 |
"""Returns SplitGenerators."""
|
131 |
+
my_urls = _URLs[self.config.name]
|
132 |
+
data_dir = dl_manager.download_and_extract(my_urls)
|
133 |
my_file_name = f"{self.config.name}_utf_8.xml"
|
134 |
return [
|
135 |
datasets.SplitGenerator(
|
|
|
172 |
|
173 |
@staticmethod
|
174 |
def _clean_text(text):
|
175 |
+
return text.replace("?", "")
|