-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[WIP] Add ability to use Tensorflow to train a word2vec model #809
Conversation
Ping @gojomo |
What is the status on tensorflow in gensim -- is there a notebook explaning the motivation, comparing the performance / pros / cons? Also, what is @gojomo 's role here? |
from gensim import utils | ||
from six import string_types | ||
import logging | ||
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't belong in module scope -- libraries do not set up logging. That's up to applications that use them.
I think the idea of being able to use TF training or import vectors from a TF session is good, but this structuring seems fragile/confusing - especially mixed-overriding & renaming of parameters. I suspect the better approach would involve some combination of: (1) a new common superclass for what is shared in implementation or interface, and having the TF implementation being a sibling class, rather than patchwork-subclass, of the traditional implementations; (2) moving the vectors-and-vocab entity out of the algorithmic entity, as proposed in #549. Of course such refactoring is a kind of big and disruptive project... |
Current status: Blocked by #549 |
@anmol01gulati This PR can now be updated to use KeyedVecs from #980 |
Extending this PR here #1033 |
The flexible architecture of tensorflow allows you to deploy computation to one or more CPUs or GPUs with a single API. The benefit of using tensorflow for training in w2v is that it can distribute computations across GPUs. This PR adds the ability for a user to easily create a w2v model that is trained using tensorflow but still allows gensim w2v methods such as
most_similar()
anddoesnt_match()
to be called on the model that is trained with tensorflow.It works around an existing tensorflow module,
tensorflow.models.embedding.word2vec_optimized