Skip to content

Commit

Permalink
Separate fetch from KorNLI (#53, #59)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovit committed Sep 8, 2020
1 parent b045129 commit 7542299
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Korpora/korpora_kornli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def __init__(self, root_dir=None, force_download=False):

if root_dir is None:
root_dir = default_korpora_path
fetch_kornli(root_dir, force_download)

for info in KORNLI_CORPUS_INFORMATION:
local_path = os.path.join(os.path.abspath(root_dir), info['destination'])
fetch(info['url'], local_path, 'kornli', force_download)
data = KorNLIData(
self.description,
*self.cleaning(load_text(local_path, num_heads=1))
Expand Down Expand Up @@ -92,3 +92,9 @@ def get_all_labels(self):
self.snli_train.get_all_labels() +
self.xnli_dev.get_all_labels() +
self.xnli_test.get_all_labels())


def fetch_kornli(root_dir, force_download):
for info in KORNLI_CORPUS_INFORMATION:
local_path = os.path.join(os.path.abspath(root_dir), info['destination'])
fetch(info['url'], local_path, 'kornli', force_download)

0 comments on commit 7542299

Please sign in to comment.