Added a distance method to the Glove class#19
Conversation
|
Looks good at first glance. I'll merge when I have access to a computer.
|
|
A couple of comments:
|
|
Sure thing. I'll commit the changes as soon as I can. |
|
@maciejkula one question. Would you like to have _check_model_fitted to check if a word dictionary has been provided as well? |
|
Good question. Maybe just leave the checks as you wrote them for the moment and I will have a look later and see if there's a non-awful solution. |
|
Okay, so I decided to retain the distance function for now, by subtracting from 1 the computed similarity. |
|
I must say I prefer to have the similarity function, it seems to me to be more consistent with the |
|
Done :) |
There was a problem hiding this comment.
Does this actually work? Maybe a leftover from the previous version?
There was a problem hiding this comment.
@owo _distance is not defined in the current version anyway. I tried running the code with the added functions _similarity and similarity but ended up with
AttributeError: 'Glove' object has no attribute '_distance'
|
We can address the Could you just check my comment above? And then maybe I'll finally merge! |
|
👍 |
Added a distance method to the Glove class to measure the distance between two arbitrary words.
I needed the functionality for my own project and thought it would be useful for this project as a whole.
Let me know if there are any other changes that may need to be done.