alba.taboas commited on
Commit ·
7997120
1
Parent(s): 1aeffad
updated SyntacticAgreement.py for nested .zip files
Browse files- SyntacticAgreement.py +10 -2
SyntacticAgreement.py
CHANGED
|
@@ -61,14 +61,22 @@ class SyntacticAgreement(GeneratorBasedBuilder):
|
|
| 61 |
supervised_keys=None,
|
| 62 |
homepage="",
|
| 63 |
license="",
|
| 64 |
-
citation="",
|
| 65 |
)
|
| 66 |
|
| 67 |
def _split_generators(self, dl_manager):
|
| 68 |
# URL to the zip archive of the selected language
|
| 69 |
base_url = "https://huggingface.co/datasets/albalbalba/SyntacticAgreement/resolve/main"
|
| 70 |
archive_url = f"{base_url}/{self.config.name}.zip"
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
return [
|
| 73 |
SplitGenerator(
|
| 74 |
name=Split.TRAIN,
|
|
|
|
| 61 |
supervised_keys=None,
|
| 62 |
homepage="",
|
| 63 |
license="",
|
| 64 |
+
citation="https://aclanthology.org/2025.depling-1.4/",
|
| 65 |
)
|
| 66 |
|
| 67 |
def _split_generators(self, dl_manager):
|
| 68 |
# URL to the zip archive of the selected language
|
| 69 |
base_url = "https://huggingface.co/datasets/albalbalba/SyntacticAgreement/resolve/main"
|
| 70 |
archive_url = f"{base_url}/{self.config.name}.zip"
|
| 71 |
+
extracted_dir = dl_manager.download_and_extract(archive_url)
|
| 72 |
+
|
| 73 |
+
# Handle case where extraction produces a nested folder (italian/italian/*.json)
|
| 74 |
+
possible_nested = os.path.join(extracted_dir, self.config.name)
|
| 75 |
+
if os.path.exists(possible_nested):
|
| 76 |
+
data_dir = possible_nested
|
| 77 |
+
else:
|
| 78 |
+
data_dir = extracted_dir
|
| 79 |
+
|
| 80 |
return [
|
| 81 |
SplitGenerator(
|
| 82 |
name=Split.TRAIN,
|