diff --git a/lda2vec/corpus.py b/lda2vec/corpus.py index b93aae0a..23915fb4 100644 --- a/lda2vec/corpus.py +++ b/lda2vec/corpus.py @@ -4,7 +4,7 @@ import pandas as pd try: - from pyxdameraulevenshtein import damerau_levenshtein_distance_withNPArray + from pyxdameraulevenshtein import damerau_levenshtein_distance_ndarray except ImportError: pass @@ -572,7 +572,7 @@ def compact_word_vectors(self, vocab, filename=None, array=None, idx = lengths >= len(word) - 3 idx &= lengths <= len(word) + 3 sel = choices[idx] - d = damerau_levenshtein_distance_withNPArray(word, sel) + d = damerau_levenshtein_distance_ndarray(word, sel) choice = np.array(keys_raw)[idx][np.argmin(d)] # choice = difflib.get_close_matches(word, choices)[0] vector = model[choice]