Skip to content

geri-m/word2vec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Word2Vec using Skip-Gram Demo

The following example shows the usage of Word2Vec and how a custom model can be improved. The implementation is based on TenorFlow, Keras, gensim and can easily be run as a Colab-Notebook

How to Test

This sample code is from the tutorial on Cambridge spark.

There is a good pre-read on towardsdatascience.com

Goal

The Goal of this sample to so tag (= classify) word types of a given text. The model should be able to answer for example the following questions as accuarte as possible.

"Is the word 'will' in the sentense 'This is my last will' a noun?"
"Is the word 'will' in the sentense 'I will do that' a verb?"

Background Information

The tags will be applied according to conll2000, (Conference on Computational Natural Language Learning).

Demonstration

The demo will show that by adding more context to a word (= taking surounding words into consideration), it is more likly to classify the word correctly.

Known Issue

If you come across the following Warning, no worries. It is a known issue and does not impact the runtime behaviour of the tutorial.

WARNING:tensorflow:AutoGraph could not transform <function Model.make_predict_function.<locals>.predict_function at 0x7f38a8c1bf28> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: Bad argument number for Name: 4, expecting 3
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
WARNING: AutoGraph could not transform <function Model.make_predict_function.<locals>.predict_function at 0x7f38a8c1bf28> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: Bad argument number for Name: 4, expecting 3
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

About

Word2Vec Example from Cambridge Spark

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors