{"action":"closed","issue":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/2268","repository_url":"https://api.github.com/repos/RaRe-Technologies/gensim","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/2268/labels{/name}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/2268/comments","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/2268/events","html_url":"https://github.com/RaRe-Technologies/gensim/issues/2268","id":381524880,"node_id":"MDU6SXNzdWUzODE1MjQ4ODA=","number":2268,"title":"Word2VecKeyedVectors (& maybe other KeyedVectors) give AttributeError if you try to add() ","user":{"login":"DanielDIQA","id":1876782,"node_id":"MDQ6VXNlcjE4NzY3ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/1876782?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielDIQA","html_url":"https://github.com/DanielDIQA","followers_url":"https://api.github.com/users/DanielDIQA/followers","following_url":"https://api.github.com/users/DanielDIQA/following{/other_user}","gists_url":"https://api.github.com/users/DanielDIQA/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielDIQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielDIQA/subscriptions","organizations_url":"https://api.github.com/users/DanielDIQA/orgs","repos_url":"https://api.github.com/users/DanielDIQA/repos","events_url":"https://api.github.com/users/DanielDIQA/events{/privacy}","received_events_url":"https://api.github.com/users/DanielDIQA/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-16T09:51:34Z","updated_at":"2018-12-14T10:39:27Z","closed_at":"2018-12-14T10:39:27Z","author_association":"NONE","body":"Hi there,\r\n\r\nexcuses for cross posting with your news group!\r\nThank you for the superb gensim-module which we find extremely helpful for our text analytics projects!\r\n\r\n#### Description\r\nWe stumbled upon an issue when we load the pre-trained google news word vectors: \r\nwe are unable to add random word vectors to the map because the \"add\"-method is not provided. \r\n\r\n#### Steps/Code/Corpus to Reproduce\r\n`import pysvn`\r\n`import numpy as np`\r\n`import gensim`\r\n`# assuming that GoogleNews-vectors-negative300.bin is extracted to local disk drive:`\r\n`# URL: https://github.com/mmihaltz/word2vec-GoogleNews-vectors/blob/master/GoogleNews-vectors-negative300.bin.gz`\r\n`# local path: D:/training-data/word2vec/GoogleNews-vectors-negative300.bin`\r\n`googleNewsModel = gensim.models.KeyedVectors.load_word2vec_format('D:/training-data/word2vec/GoogleNews-vectors-negative300.bin', binary=True) `\r\n`googleNewsModel.add(list('unknown word'), list(np.random.random(300))) `\r\n\r\n#### Expected Results\r\nNew token, vector are added to the model.\r\n\r\n#### Actual Results\r\n`returns error: AttributeError: 'Word2VecKeyedVectors' object has no attribute 'add' `\r\n\r\nTraceback (most recent call last):\r\n\r\n  File \"<ipython-input-1-f0d2181562f3>\", line 1, in <module>\r\n    runfile('C:/Users/hansch/../gensim_issue.py', wdir='C:/Users/hansch/../eurolex')\r\n\r\n  File \"C:\\Users\\hansch\\AppData\\Local\\conda\\conda\\envs\\gpupy36gensim\\lib\\site-packages\\spyder_kernels\\customize\\spydercustomize.py\", line 668, in runfile\r\n    execfile(filename, namespace)\r\n\r\n  File \"C:\\Users\\hansch\\AppData\\Local\\conda\\conda\\envs\\gpupy36gensim\\lib\\site-packages\\spyder_kernels\\customize\\spydercustomize.py\", line 108, in execfile\r\n    exec(compile(f.read(), filename, 'exec'), namespace)\r\n\r\n  File \"C:/Users/hansch/../gensim_issue.py\", line 11, in <module>\r\n    googleNewsModel.add(list('unknown word'), list(np.random.random(300))) # add the token and the random wordvector to the google News word vectors\r\n\r\nAttributeError: 'Word2VecKeyedVectors' object has no attribute 'add'\r\n\r\n\r\n\r\n#### Versions\r\nwindows server 2012\r\npython 3.6\r\ngensim 3.6.0\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"menshikh-iv"}}