Datasets:
Commit
·
62e6c42
1
Parent(s):
63ad164
Update nlprepl.py
Browse files- nlprepl.py +7 -5
nlprepl.py
CHANGED
|
@@ -96,7 +96,7 @@ _URLS = {
|
|
| 96 |
class NLPrePLConfig(datasets.BuilderConfig):
|
| 97 |
"""BuilderConfig for NKJP1M"""
|
| 98 |
|
| 99 |
-
def __init__(self, tagset, extension, **kwargs):
|
| 100 |
"""BuilderConfig forNKJP1M.
|
| 101 |
|
| 102 |
Args:
|
|
@@ -109,7 +109,7 @@ class NLPrePLConfig(datasets.BuilderConfig):
|
|
| 109 |
|
| 110 |
|
| 111 |
class NLPrePL(datasets.GeneratorBasedBuilder):
|
| 112 |
-
"""
|
| 113 |
|
| 114 |
BUILDER_CONFIGS = [
|
| 115 |
NLPrePLConfig(
|
|
@@ -123,6 +123,7 @@ class NLPrePL(datasets.GeneratorBasedBuilder):
|
|
| 123 |
]
|
| 124 |
|
| 125 |
def _info(self):
|
|
|
|
| 126 |
dataset, tagset, extension = self.config.name.split("-")
|
| 127 |
|
| 128 |
return datasets.DatasetInfo(
|
|
@@ -145,12 +146,11 @@ class NLPrePL(datasets.GeneratorBasedBuilder):
|
|
| 145 |
}
|
| 146 |
),
|
| 147 |
supervised_keys=None,
|
| 148 |
-
homepage="http://nkjp.pl/",
|
| 149 |
citation=_CITATION,
|
| 150 |
)
|
| 151 |
|
| 152 |
def _split_generators(self, dl_manager):
|
| 153 |
-
"""Returns SplitGenerators."""
|
| 154 |
dataset, tagset, extension = self.config.name.split("-")
|
| 155 |
urls = _URLS[dataset][extension][tagset]
|
| 156 |
downloaded_files = dl_manager.download_and_extract(urls)
|
|
@@ -166,9 +166,11 @@ class NLPrePL(datasets.GeneratorBasedBuilder):
|
|
| 166 |
gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 167 |
]
|
| 168 |
|
| 169 |
-
def _generate_examples(self, filepath):
|
|
|
|
| 170 |
|
| 171 |
def generate_misc_column(misc_content: dict):
|
|
|
|
| 172 |
if misc_content is None:
|
| 173 |
return ""
|
| 174 |
else:
|
|
|
|
| 96 |
class NLPrePLConfig(datasets.BuilderConfig):
|
| 97 |
"""BuilderConfig for NKJP1M"""
|
| 98 |
|
| 99 |
+
def __init__(self, tagset: str, extension: str, **kwargs):
|
| 100 |
"""BuilderConfig forNKJP1M.
|
| 101 |
|
| 102 |
Args:
|
|
|
|
| 109 |
|
| 110 |
|
| 111 |
class NLPrePL(datasets.GeneratorBasedBuilder):
|
| 112 |
+
"""NLPrePL dataset generator."""
|
| 113 |
|
| 114 |
BUILDER_CONFIGS = [
|
| 115 |
NLPrePLConfig(
|
|
|
|
| 123 |
]
|
| 124 |
|
| 125 |
def _info(self):
|
| 126 |
+
"""Informative function about dataset features"""
|
| 127 |
dataset, tagset, extension = self.config.name.split("-")
|
| 128 |
|
| 129 |
return datasets.DatasetInfo(
|
|
|
|
| 146 |
}
|
| 147 |
),
|
| 148 |
supervised_keys=None,
|
|
|
|
| 149 |
citation=_CITATION,
|
| 150 |
)
|
| 151 |
|
| 152 |
def _split_generators(self, dl_manager):
|
| 153 |
+
"""Returns SplitGenerators for train, dev, and test splits."""
|
| 154 |
dataset, tagset, extension = self.config.name.split("-")
|
| 155 |
urls = _URLS[dataset][extension][tagset]
|
| 156 |
downloaded_files = dl_manager.download_and_extract(urls)
|
|
|
|
| 166 |
gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 167 |
]
|
| 168 |
|
| 169 |
+
def _generate_examples(self, filepath: str):
|
| 170 |
+
"""Function to generate example datapoints for the dataset."""
|
| 171 |
|
| 172 |
def generate_misc_column(misc_content: dict):
|
| 173 |
+
"""Helper function that creates proper formatting for MISC column from conllu file."""
|
| 174 |
if misc_content is None:
|
| 175 |
return ""
|
| 176 |
else:
|