Datasets:
SuzanaB
commited on
Commit
·
6ef5980
1
Parent(s):
984bb85
Add download from URL
Browse files
hr500k.py
CHANGED
@@ -31,6 +31,7 @@ are encoded as class labels.
|
|
31 |
_HOMEPAGE = 'https://www.clarin.si/repository/xmlui/handle/11356/1183#'
|
32 |
_LICENSE = ''
|
33 |
|
|
|
34 |
_TRAINING_FILE = 'train_ner.conllu'
|
35 |
_DEV_FILE = 'dev_ner.conllu'
|
36 |
_TEST_FILE = 'test_ner.conllu'
|
@@ -110,15 +111,23 @@ class Hr500K(datasets.GeneratorBasedBuilder):
|
|
110 |
)
|
111 |
|
112 |
def _split_generators(self, dl_manager):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
return [
|
114 |
datasets.SplitGenerator(
|
115 |
-
name=datasets.Split.TRAIN, gen_kwargs={'filepath':
|
116 |
),
|
117 |
datasets.SplitGenerator(
|
118 |
-
name=datasets.Split.VALIDATION, gen_kwargs={'filepath':
|
119 |
),
|
120 |
datasets.SplitGenerator(
|
121 |
-
name=datasets.Split.TEST, gen_kwargs={'filepath':
|
122 |
),
|
123 |
]
|
124 |
|
@@ -178,3 +187,6 @@ class Hr500K(datasets.GeneratorBasedBuilder):
|
|
178 |
'iob_tags': iob_tags
|
179 |
}
|
180 |
|
|
|
|
|
|
|
|
31 |
_HOMEPAGE = 'https://www.clarin.si/repository/xmlui/handle/11356/1183#'
|
32 |
_LICENSE = ''
|
33 |
|
34 |
+
_URL = 'https://huggingface.co/datasets/classla/hr500k'
|
35 |
_TRAINING_FILE = 'train_ner.conllu'
|
36 |
_DEV_FILE = 'dev_ner.conllu'
|
37 |
_TEST_FILE = 'test_ner.conllu'
|
|
|
111 |
)
|
112 |
|
113 |
def _split_generators(self, dl_manager):
|
114 |
+
"""Returns SplitGenerators."""
|
115 |
+
urls_to_download = {
|
116 |
+
'train': f"{_URL}{_TRAINING_FILE}",
|
117 |
+
'dev': f"{_URL}{_DEV_FILE}",
|
118 |
+
'test': f"{_URL}{_TEST_FILE}",
|
119 |
+
}
|
120 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
121 |
+
|
122 |
return [
|
123 |
datasets.SplitGenerator(
|
124 |
+
name=datasets.Split.TRAIN, gen_kwargs={'filepath': downloaded_files['train'], 'split': 'train'}
|
125 |
),
|
126 |
datasets.SplitGenerator(
|
127 |
+
name=datasets.Split.VALIDATION, gen_kwargs={'filepath': downloaded_files['dev'], 'split': 'dev'}
|
128 |
),
|
129 |
datasets.SplitGenerator(
|
130 |
+
name=datasets.Split.TEST, gen_kwargs={'filepath': downloaded_files['test'], 'split': 'test'}
|
131 |
),
|
132 |
]
|
133 |
|
|
|
187 |
'iob_tags': iob_tags
|
188 |
}
|
189 |
|
190 |
+
|
191 |
+
dataset = datasets.load_dataset('hr500k.py', split='test')
|
192 |
+
print(dataset.info)
|