Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code giving error #4

Open
sudarshan85 opened this issue Mar 12, 2018 · 0 comments
Open

Code giving error #4

sudarshan85 opened this issue Mar 12, 2018 · 0 comments

Comments

@sudarshan85
Copy link

Hi,

This is a great resource. I wanted to point out that some of the code especially for LDA analyzing and word vector creation is not working. I am guessing that this is due to updated version of gensim. Also some of the code shows errors for Python 3.

# build a list of the terms, integer indices,
# and term counts from the food2vec model vocabulary
ordered_vocab = [(term, voc.index, voc.count) for term, voc in food2vec.vocab.items()]

This is giving me an error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-21-2c76ac03d027> in <module>()
      1 # build a list of the terms, integer indices,
      2 # and term counts from the food2vec model vocabulary
----> 3 ordered_vocab = [(term, voc.index, voc.count) for term, voc in food2vec.vocab.items()]

AttributeError: 'Word2Vec' object has no attribute 'vocab'

I'm am trying to update the code to bring the original output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant