Glove loader - Code changes and unit tests.
1. Added methods to download, extract and load glove vectors. 2. Added units tests to test the public methods. Other changes 1. Made download and extract methods private. 2. Refactored Word2vec unit tests to exclude private methods.
This commit is contained in:
Родитель
c9006c8b65
Коммит
008bfa2c57
|
@ -39,6 +39,7 @@ def test_load_pretrained_vectors_word2vec():
|
|||
|
||||
shutil.rmtree(os.path.join(os.getcwd(), dir_path))
|
||||
|
||||
assert isinstance(load_word2vec(dir_path), Word2VecKeyedVectors)
|
||||
|
||||
def test_load_pretrained_vectors_glove():
|
||||
dir_path = "temp_data/"
|
||||
|
|
|
@ -87,7 +87,6 @@ def load_pretrained_vectors(dir_path, file_name="glove.840B.300d.txt", limit=Non
|
|||
|
||||
Returns:
|
||||
gensim.models.keyedvectors.Word2VecKeyedVectors: Loaded word2vectors
|
||||
|
||||
"""
|
||||
|
||||
file_path = _maybe_download_and_extract(dir_path, file_name)
|
||||
|
|
Загрузка…
Ссылка в новой задаче