{"action":"created","issue":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1276","repository_url":"https://api.github.com/repos/RaRe-Technologies/gensim","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1276/labels{/name}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1276/comments","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1276/events","html_url":"https://github.com/RaRe-Technologies/gensim/issues/1276","id":221202195,"number":1276,"title":"wordrank_comparisions typeerror","user":{"login":"luoyangen","id":3061079,"avatar_url":"https://avatars0.githubusercontent.com/u/3061079?v=3","gravatar_id":"","url":"https://api.github.com/users/luoyangen","html_url":"https://github.com/luoyangen","followers_url":"https://api.github.com/users/luoyangen/followers","following_url":"https://api.github.com/users/luoyangen/following{/other_user}","gists_url":"https://api.github.com/users/luoyangen/gists{/gist_id}","starred_url":"https://api.github.com/users/luoyangen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luoyangen/subscriptions","organizations_url":"https://api.github.com/users/luoyangen/orgs","repos_url":"https://api.github.com/users/luoyangen/repos","events_url":"https://api.github.com/users/luoyangen/events{/privacy}","received_events_url":"https://api.github.com/users/luoyangen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-12T09:24:57Z","updated_at":"2017-04-12T11:36:01Z","closed_at":null,"body":"hi,\r\n    I'm trying to run the [wordrank_comparisions](https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/Wordrank_comparisons.ipynb), but while training the wordrank model, got the error: TypeError: train() takes at least 4 arguments (7 given).\r\n    I can't figure out whether the code error or my python environment, but other wordrank models is successes trained. waiting for help. thx.\r\n"},"comment":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/comments/293550470","html_url":"https://github.com/RaRe-Technologies/gensim/issues/1276#issuecomment-293550470","issue_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1276","id":293550470,"user":{"login":"luoyangen","id":3061079,"avatar_url":"https://avatars0.githubusercontent.com/u/3061079?v=3","gravatar_id":"","url":"https://api.github.com/users/luoyangen","html_url":"https://github.com/luoyangen","followers_url":"https://api.github.com/users/luoyangen/followers","following_url":"https://api.github.com/users/luoyangen/following{/other_user}","gists_url":"https://api.github.com/users/luoyangen/gists{/gist_id}","starred_url":"https://api.github.com/users/luoyangen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luoyangen/subscriptions","organizations_url":"https://api.github.com/users/luoyangen/orgs","repos_url":"https://api.github.com/users/luoyangen/repos","events_url":"https://api.github.com/users/luoyangen/events{/privacy}","received_events_url":"https://api.github.com/users/luoyangen/received_events","type":"User","site_admin":false},"created_at":"2017-04-12T11:36:01Z","updated_at":"2017-04-12T11:36:01Z","body":"@tmylk the line is \r\n`get_ipython().magic(u'time wr_model = Wordrank.train(WR_HOME, corpus_file,  **wr_params); wr_model')`\r\n\r\nthe error log is:\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-2-680aa3ec029d> in <module>()\r\n     75         print('\\nUsing existing model file {:s}.vec'.format(output_file))\r\n     76 \r\n---> 77 train_models(corpus_file='proc_brown_corp.txt', output_name='brown')\r\n\r\n<ipython-input-2-680aa3ec029d> in train_models(corpus_file, output_name)\r\n     59     if not os.path.isfile(os.path.join(MODELS_DIR, '{:s}.vec'.format(output_file))):\r\n     60         print('\\nTraining wordrank on {:s} corpus..'.format(corpus_file))\r\n---> 61         get_ipython().magic(u'time wr_model = Wordrank.train(WR_HOME, corpus_file,  **wr_params); wr_model')\r\n     62         locals()['wr_model'].wv.save_word2vec_format(os.path.join(MODELS_DIR, '{:s}.vec'.format(output_file)))\r\n     63         print('\\nSaved wordrank model as {:s}.vec'.format(output_file))\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)\r\n   2156         magic_name, _, magic_arg_s = arg_s.partition(' ')\r\n   2157         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)\r\n-> 2158         return self.run_line_magic(magic_name, magic_arg_s)\r\n   2159 \r\n   2160     #-------------------------------------------------------------------------\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)\r\n   2077                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals\r\n   2078             with self.builtin_trap:\r\n-> 2079                 result = fn(*args,**kwargs)\r\n   2080             return result\r\n   2081 \r\n\r\n<decorator-gen-59> in time(self, line, cell, local_ns)\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)\r\n    186     # but it's overkill for just that one bit of state.\r\n    187     def magic_deco(arg):\r\n--> 188         call = lambda f, *a, **k: f(*a, **k)\r\n    189 \r\n    190         if callable(arg):\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)\r\n   1178         else:\r\n   1179             st = clock2()\r\n-> 1180             exec(code, glob, local_ns)\r\n   1181             end = clock2()\r\n   1182             out = None\r\n\r\n<timed exec> in <module>()\r\n\r\nTypeError: train() takes at least 4 arguments (7 given)\r\n"}}
{"actor":{"display_login":"luoyangen"}}