You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for providing this script for the public community.
I ran your code based on Karpathy's Nipspreview. I generally follow his README.md file to generate the respective wordclouds, thumbnails etc but I find that when I execute python lda.py -f allpapers.txt -k 7 --alpha=0.5 --beta=0.5 -i 100, I got the following output:
$ python lda.py -f allpapers.txt -k 7 --alpha=0.5 --beta=0.5 -i 100
Traceback (most recent call last):
File "lda.py", line 150, in
main()
File "lda.py", line 139, in main
docs = [voca.doc_to_ids(doc) for doc in corpus]
File "/home/lex/Desktop/nipspreview/vocabulary.py", line 65, in doc_to_ids
id = self.term_to_id(term)
File "/home/lex/Desktop/nipspreview/vocabulary.py", line 48, in term_to_id
term = lemmatize(term0)
File "/home/lex/Desktop/nipspreview/vocabulary.py", line 35, in lemmatize
w = wl.lemmatize(w0.lower())
File "/usr/local/lib/python2.7/dist-packages/nltk/stem/wordnet.py", line 40, in lemmatize
lemmas = wordnet._morphy(word, pos)
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/util.py", line 99, in getattr
self.__load()
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/util.py", line 64, in __load
except LookupError: raise e
LookupError:
Resource u'corpora/wordnet' not found. Please use the NLTK
Downloader to obtain the resource: >>> nltk.download()
Searched in:
- '/home/lex/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
and I'm wondering what is wrong? Could you help me out? Thanks!
The text was updated successfully, but these errors were encountered:
I've figured this out. Pardon my taking your time please.
I needed to download 'corpora/wordnet'. So I entered python, imported nltk, import nltk and then did nltk.download() which seems to fix the issue nicely.
Thanks once again~!
Hi @shuyo ,
Thanks a lot for providing this script for the public community.
I ran your code based on Karpathy's Nipspreview. I generally follow his README.md file to generate the respective wordclouds, thumbnails etc but I find that when I execute
python lda.py -f allpapers.txt -k 7 --alpha=0.5 --beta=0.5 -i 100
, I got the following output:and I'm wondering what is wrong? Could you help me out? Thanks!
The text was updated successfully, but these errors were encountered: