Coder Social home page Coder Social logo

ml-lab / wordembeddingautoencoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paralleldots/wordembeddingautoencoder

0.0 3.0 0.0 18.36 MB

An autoencoder to calculate word embeddings as mentioned in Lebret/Collobert paper 2015

License: Other

Python 100.00%

wordembeddingautoencoder's Introduction

Tyrion - Word Embedding Autoencoder

An autoencoder to calculate word embeddings as mentioned in Lebret/Collobert paper 2015

Runs the model mentined in http://arxiv.org/abs/1412.4930 on set of text files stored in directory on GPU

With GPU support code is 5-8x faster than it's CPU version.

Requirements:

  1. Numpy http://www.numpy.org/

  2. Theano http://deeplearning.net/software/theano/install.html

  3. Scipy http://www.scipy.org/install.html

Installation

To install the package follow the instructions mentioned below

Install from source

To install the package from source run setup.py file, it will install and include necessary files in system python directory

$ python setup.py install

Installtion from pip

Tyrion can also be install from pip. Run following command from console

$ pip install tyrion

Training

To train the model on bunch of text files run following commnands in python console:

There is a sample data folder in project's folder, that can be used for sanity checking

>> from tyrion import train

>> train.train('/path/to/text/corpus')

Setting hyperparameters

Different hyperparameters are set by default in training module, to set hyperparamters manually use following command while training >> from tyrion import train

>> train.train('/path/to/text/corpus', contextSize=size, min_count=count, newdims=dims, ntimes=ntimes, lr=learningrate)

Arguments explained:

  1. ContextSize is the contex window size used for constructing coocurence matrix

  2. min_count is minimum threshold frequency for words, removes garbage words below this frequency

  3. newdims is the dimension of embedding desired.

  4. ntimes is number of epochs for training model

  5. lr is the learning rate to drive optimization routine

Utility functions

To generate word embeddings and to find closest words to a word, use utils module in tyrion. Ex.

>> from tyrion import utils

>> embedding = utils.gen_embedding('word')

>> close_words = utils.closest_words('word',n=10)

Future work

  1. Implement a closely related paper on phrase embeddings (http://arxiv.org/abs/1506.05703) (ICML 2015)
  2. Try implementing AdaGrad ( for optimization )

wordembeddingautoencoder's People

Contributors

shashankg7 avatar mach17 avatar

Watchers

Noon van der Silk avatar James Cloos avatar  avatar

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.