Coder Social home page Coder Social logo

n0obcoder / skip-gram-model-pytorch Goto Github PK

View Code? Open in Web Editor NEW
48.0 2.0 12.0 51 KB

PyTorch implementation of the Word2Vec (Skip-Gram Model) and visualizing the trained embeddings using TSNE

Python 100.00%
skipgram skip-gram nlp natural-language-processing tsne word2vec wordembeddings pytorch python neural-networks

skip-gram-model-pytorch's Introduction

Skip-Gram-Model-PyTorch

PyTorch implementation of the word2vec (skip-gram model) and visualization of the trained embeddings using TSNE !

2D representaion of some of the trained word embeddings

My TensorFlow implemntation of Skip-Gram Model can be found here.

Requirements

  • torch >= 1.4
  • numpy >= 1.18
  • matplotlib
  • tqdm
  • nltk
  • gensim

Training

python main.py

Visualizing real-time training loss in Tensorboard

tensorboard --logdir <PATH_TO_TENSORBOARD_EVENTS_FILE>

NOTE: By default, PATH_TO_TENSORBOARD_EVENTS_FILE is set to SUMMARY_DIR in config.py

Testing

python test.py

Inference

war india crime guitar movies desert physics religion football computer
fight europe despite band movie region theory religious team program
battle central help play series along mathematics christian win systems
army western seek record show western mathematical regard sport available
force indian challenge piece film southern study tradition club design
ally part fail star feature plain science christianity league information

Blog-Post

Check out my blog post on word2vec here.

skip-gram-model-pytorch's People

Contributors

n0obcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

skip-gram-model-pytorch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.