Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lda2vec/corpus.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
from collections import defaultdict
import numpy as np
import difflib
Expand Down Expand Up @@ -576,7 +577,7 @@ def compact_word_vectors(self, vocab, filename=None, array=None,
choice = np.array(keys_raw)[idx][np.argmin(d)]
# choice = difflib.get_close_matches(word, choices)[0]
vector = model[choice]
print compact, word, ' --> ', choice
print(compact, word, ' --> ', choice)
except IndexError:
pass
if vector is None:
Expand Down
3 changes: 2 additions & 1 deletion lda2vec/topics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import numpy as np
import requests
import multiprocessing
Expand Down Expand Up @@ -103,7 +104,7 @@ def print_top_words_per_topic(data, top_n=10, do_print=True):
top_words = [data['vocab'][i].strip().replace(' ', '_') for i in top]
msg = ' '.join(top_words)
if do_print:
print prefix + msg
print(prefix + msg)
lists.append(top_words)
return lists

Expand Down