Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning when string is used as argument to infer_vector() #2347

Merged
merged 5 commits into from
Jan 23, 2019
Merged
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: 3 additions & 0 deletions gensim/models/doc2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,9 @@ def infer_vector(self, doc_words, alpha=None, min_alpha=None, epochs=None, steps
The inferred paragraph vector for the new document.

"""
if isinstance(doc_words, string_types):
raise TypeError("Parameter doc_words of infer_vector() must be a list of strings (not a single string).")

alpha = alpha or self.alpha
min_alpha = min_alpha or self.min_alpha
epochs = epochs or steps or self.epochs
Expand Down