diff --git a/gensim/models/doc2vec.py b/gensim/models/doc2vec.py index 46508afdb3..9812dc5ef4 100644 --- a/gensim/models/doc2vec.py +++ b/gensim/models/doc2vec.py @@ -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