This is a simple demonstration of how word embedding works in tensorflow 2.0. The implementation is directly based on this tutorial paper:
- word2vec Parameter Learning Explained
- and its online demo wevi
which are based on these two pioneering works:
- Efficient Estimation of Word Representations in Vector Space
- Distributed Representations of Words and Phrases and their Compositionality
The wevi demo has already given an amazing visualization of word embedding. This project tries to replicate its result using Tensorflow 2.x, which is more practical, and whose code can be reused in the future work.
The code is tested under these packages:
- Python 3.6
- numpy 1.17.2
- sklearn 0.21.3
- matplotlib 3.1.1
- tensorflow 2.0.0
Here is an online Colab notebook for a quick look, although it's quite bulky.