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
Error using the most similar method #5
Comments
This looks easy to fix. The function signature in your error report above tell you that the second parameter is Here's how you retrieve a vector for an entry and issue a
The code is still a bit rough to use, this will change before we officially release it on PyPI. Also, we would love to hear about your use case. If you want don't want to discuss this publicly please get in contact with me at hp@spacy.io. |
Hi @henningpeters , Thanks for responding to the issue.
So my two questions are:
I understand that the code is rough, and hence I highly appreciate your time in explaining the concepts and running of the code. As per my use case, I don't have one at the moment, as I am just learning the concepts of NLP and saw your sense2vec implementation and demo (which got me excited a lot) and wanted to play around with it. |
It says that |
Hi @henningpeters Thanks for the real quick reply. I checked out the load function of the Vectormap class. I made sure that the load function had the right path for the vectors.bin, strings.json and freqs.json files
I even tried but still received the same error, using the entry "beekeepers|NOUN" that I found in the strings.json file. I have opened the files as mentioned by you and read the implementation of Vectormap class from the file as linked in your above comment, but I am still not getting the piece that I am missing. |
That seems strange, I cannot reproduce this behavior on my system (Linux, Atlas, Python 3.4). Output here is:
On which platform are you and against which blas library did you compile? |
Hi @henningpeters , Thank you for getting back on the issue. I use the following: Ubuntu 14.04, Atlas and Python 2.7.11. |
Hey @henningpeters , I tried to train the vectors fresh on a Project Gutenberg eBook text file, so that I can check if they also produce the same error with the
Also wanted to ask that does the |
Hey @henningpeters Nevermind the above comment I figured out from looking at |
…tation, also fixes explosion/sense2vec#5 for py2
There was indeed an error within spaCy that broke compatibility with Python<3.3 |
It's nice to accidentally support lots of versions, and I'd rather make changes to keep our code more general. But we don't promise support for Python < 3.3 do we? Python 3.0 was basically unusable, and Python 3.1 was pretty terrible. Most libraries only support 3.3+ I think? |
Maybe I was a bit unclear. Of course I meant primarily 2.7, but the change also fixes "accidentally" everything in between. |
Hi @henningpeters , Thanks for clearing out the error in Python 2.7 and I confirm that the |
Following the successful installation of sense2vec, I got the model loaded as described in the response to the issue #3, but I am getting an error when I try to use the
most_similar
method.Following is what I entered after loading the model:
print vector_map.most_similar("education", topn=10)
Below is the error I receive.
So I understand that the
most_similar
method wants a float parameter followed by an int parameter. I thought the function will expect similar arguments as to gensim's word2vec implementation ofmost_similar
method.I request if please I could be shown how to use the
most_similar
method in the sense2vec implementation.The text was updated successfully, but these errors were encountered: