Following the tutorial, saving a dictionary

358 views
Skip to first unread message

Andrew Xu

unread,
Dec 30, 2013, 8:42:12 PM12/30/13
to gen...@googlegroups.com
Hi! 
     Firstly, thanks for the great work with gensim!
     I'm following the tutorial here (http://radimrehurek.com/gensim/tut1.html) but when I save the dictionary here: (dictionary.save('/tmp/deerwester.dict') # store the dictionary, for future reference) I get this problem:  

INFO : saving Dictionary object to /tmp/deerwester.dict

Traceback (most recent call last):
  File "<pyshell#30>", line 1, in <module>
    dictionary.save('/tmp/deerwester.dict')
  File "C:\Python27\lib\site-packages\gensim-0.8.8-py2.7.egg\gensim\utils.py", line 180, in save
    pickle(self, fname)
  File "C:\Python27\lib\site-packages\gensim-0.8.8-py2.7.egg\gensim\utils.py", line 529, in pickle
    with smart_open(fname, 'wb') as fout: # 'b' for binary, needed on Windows
  File "C:\Python27\lib\site-packages\gensim-0.8.8-py2.7.egg\gensim\utils.py", line 524, in smart_open
    return open(fname, mode)
IOError: [Errno 2] No such file or directory: '/tmp/deerwester.dict'

  Any advice is greatly appreciated.
          Thanks!

Roger Leitzke

unread,
Dec 31, 2013, 3:30:53 AM12/31/13
to gen...@googlegroups.com

Hi Andrew,

'/tmp/deerwester.dict' is the place where you want to save your dictionary. This is an example and works in Linux machines. In machines running Windows, the path should be something like 'C:\...\deerwester.dict'.

--
You received this message because you are subscribed to the Google Groups "gensim" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gensim+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages