{"action":"created","issue":{"url":"https://api.github.com/repos/piskvorky/gensim/issues/407","labels_url":"https://api.github.com/repos/piskvorky/gensim/issues/407/labels{/name}","comments_url":"https://api.github.com/repos/piskvorky/gensim/issues/407/comments","events_url":"https://api.github.com/repos/piskvorky/gensim/issues/407/events","html_url":"https://github.com/piskvorky/gensim/issues/407","id":96441746,"number":407,"title":"AttributeError: 'Doc2Vec' object has no attribute '_prepare_items'","user":{"login":"ryankohl","id":614808,"avatar_url":"https://avatars.githubusercontent.com/u/614808?v=3","gravatar_id":"","url":"https://api.github.com/users/ryankohl","html_url":"https://github.com/ryankohl","followers_url":"https://api.github.com/users/ryankohl/followers","following_url":"https://api.github.com/users/ryankohl/following{/other_user}","gists_url":"https://api.github.com/users/ryankohl/gists{/gist_id}","starred_url":"https://api.github.com/users/ryankohl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryankohl/subscriptions","organizations_url":"https://api.github.com/users/ryankohl/orgs","repos_url":"https://api.github.com/users/ryankohl/repos","events_url":"https://api.github.com/users/ryankohl/events{/privacy}","received_events_url":"https://api.github.com/users/ryankohl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-21T23:52:31Z","updated_at":"2015-07-23T19:18:18Z","closed_at":null,"body":"After training a Doc2Vec model (with the Brown corpus), I went ahead and attempted scoring.  However, I got the following error:\r\nAttributeError: 'Doc2Vec' object has no attribute '_prepare_items'\r\n\r\nAnd indeed, neither Word2Vec nor Doc2Vec seem to have that method.  In an older version of gensim (0.10.3), there was reference to a '_prepare_sentences', which was indeed a method in Doc2Vec.\r\n\r\nGuessing the method just got lost in a refactor?"},"comment":{"url":"https://api.github.com/repos/piskvorky/gensim/issues/comments/124215943","html_url":"https://github.com/piskvorky/gensim/issues/407#issuecomment-124215943","issue_url":"https://api.github.com/repos/piskvorky/gensim/issues/407","id":124215943,"user":{"login":"gojomo","id":1641,"avatar_url":"https://avatars.githubusercontent.com/u/1641?v=3","gravatar_id":"","url":"https://api.github.com/users/gojomo","html_url":"https://github.com/gojomo","followers_url":"https://api.github.com/users/gojomo/followers","following_url":"https://api.github.com/users/gojomo/following{/other_user}","gists_url":"https://api.github.com/users/gojomo/gists{/gist_id}","starred_url":"https://api.github.com/users/gojomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gojomo/subscriptions","organizations_url":"https://api.github.com/users/gojomo/orgs","repos_url":"https://api.github.com/users/gojomo/repos","events_url":"https://api.github.com/users/gojomo/events{/privacy}","received_events_url":"https://api.github.com/users/gojomo/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T19:18:18Z","updated_at":"2015-07-23T19:18:18Z","body":"I'm not sure 'score' has a strong/straightforward interpretation for Doc2Vec – except indirectly because of the similarity of many of the training modes.... which might lead to plausibly-useful results even without intentional design. \r\n\r\n`infer_vector` returns a model-compatible N-dimensional doc vector for new input – so I don't see it as being directly analogous to the (scalar) 'score' value. Though perhaps, if you squint at it in some corner case, it can have similar utility? (Maybe if you do a single-pass infer, starting from an all-zeros vector, the resulting vector's magnitude is somehow roughly correlative to 'score'? Or if you keep running the inference gradient-descent until the internal error stops getting better, the best error achievable, in a full-document pass, is roughly usable like a 'score'?)\r\n\r\nUltimately it may be possible to merge score-returning functionality with the train methods: have one extra parameter, default false, as to whether the errors-during-training should be accumulated aside somewhere in the proper manner. (Or maybe that's just what they would do when all the optional train_words/train_hidden switches are off?) But I'd only want to do this if the readability/performance impact in the usual real-training case is minimal."}}