Upload raco_forums_corpus.py
Browse files- raco_forums_corpus.py +6 -10
raco_forums_corpus.py
CHANGED
|
@@ -32,9 +32,9 @@ _HOMEPAGE = "https://www.racocatala.cat/forums"
|
|
| 32 |
|
| 33 |
_LICENSE = "Creative Commons Non-commercial 4.0 International"
|
| 34 |
|
| 35 |
-
_URL = "https://zenodo.org/record/
|
| 36 |
-
_TRAINING_FILE = "
|
| 37 |
-
_DEV_FILE = "
|
| 38 |
|
| 39 |
|
| 40 |
class RacoForumsCorpus(datasets.GeneratorBasedBuilder):
|
|
@@ -53,14 +53,10 @@ class RacoForumsCorpus(datasets.GeneratorBasedBuilder):
|
|
| 53 |
)
|
| 54 |
|
| 55 |
def _split_generators(self, dl_manager):
|
| 56 |
-
|
| 57 |
-
"train": f"{_URL}{_TRAINING_FILE}",
|
| 58 |
-
"dev": f"{_URL}{_DEV_FILE}",
|
| 59 |
-
}
|
| 60 |
-
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 61 |
return [
|
| 62 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath":
|
| 63 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath":
|
| 64 |
]
|
| 65 |
|
| 66 |
|
|
|
|
| 32 |
|
| 33 |
_LICENSE = "Creative Commons Non-commercial 4.0 International"
|
| 34 |
|
| 35 |
+
_URL = "https://zenodo.org/record/7254179/files/data.zip?download=1"
|
| 36 |
+
_TRAINING_FILE = "train.txt"
|
| 37 |
+
_DEV_FILE = "valid.txt"
|
| 38 |
|
| 39 |
|
| 40 |
class RacoForumsCorpus(datasets.GeneratorBasedBuilder):
|
|
|
|
| 53 |
)
|
| 54 |
|
| 55 |
def _split_generators(self, dl_manager):
|
| 56 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
return [
|
| 58 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir, "data", _TRAINING_FILE)}),
|
| 59 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, "data", _DEV_FILE)}),
|
| 60 |
]
|
| 61 |
|
| 62 |
|