update
Browse files- corpuscrawler-ga.py +2 -3
corpuscrawler-ga.py
CHANGED
@@ -80,8 +80,6 @@ class CorpusCrawlerIrish(datasets.GeneratorBasedBuilder):
|
|
80 |
def _split_generators(self, dl_manager):
|
81 |
manual_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
|
82 |
|
83 |
-
if not self.config.name:
|
84 |
-
raise ValueError(f"Scrape set must be specified, but got name={self.config.name}")
|
85 |
scrape_set = self.config.name
|
86 |
sset = self.config.name.split('_')[0]
|
87 |
dl_path = dl_manager.download(_DATA_URL.format(sset))
|
@@ -100,7 +98,6 @@ class CorpusCrawlerIrish(datasets.GeneratorBasedBuilder):
|
|
100 |
"""Generate examples from a Corpus Crawl cache."""
|
101 |
logger.info("generating examples from = %s", name)
|
102 |
scfg = self.config.name.split('_')[1]
|
103 |
-
logger.info("reading links from = %s", data_file)
|
104 |
links = _get_links(data_file)
|
105 |
if not self.config.data_dir:
|
106 |
self.config.data_dir = data_dir
|
@@ -612,6 +609,8 @@ def do_forasnagaeilge_ie(fetchresult):
|
|
612 |
|
613 |
def _get_links(scrape):
|
614 |
links = set()
|
|
|
|
|
615 |
with open(scrape) as f:
|
616 |
for url in f.readlines():
|
617 |
links.add(url.rstrip())
|
|
|
80 |
def _split_generators(self, dl_manager):
|
81 |
manual_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
|
82 |
|
|
|
|
|
83 |
scrape_set = self.config.name
|
84 |
sset = self.config.name.split('_')[0]
|
85 |
dl_path = dl_manager.download(_DATA_URL.format(sset))
|
|
|
98 |
"""Generate examples from a Corpus Crawl cache."""
|
99 |
logger.info("generating examples from = %s", name)
|
100 |
scfg = self.config.name.split('_')[1]
|
|
|
101 |
links = _get_links(data_file)
|
102 |
if not self.config.data_dir:
|
103 |
self.config.data_dir = data_dir
|
|
|
609 |
|
610 |
def _get_links(scrape):
|
611 |
links = set()
|
612 |
+
if not os.path.exists(scrape):
|
613 |
+
raise Exception(f"File {scrape} does not exist")
|
614 |
with open(scrape) as f:
|
615 |
for url in f.readlines():
|
616 |
links.add(url.rstrip())
|