GithubHelp home page GithubHelp logo

andrewluetgers / embeddings.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mb-14/embeddings.js

0.0 1.0 0.0 18.4 MB

Word embeddings for the web

Home Page: https://mb-14.github.io/embeddings.js/

Shell 1.43% JavaScript 39.22% Python 28.58% HTML 30.77%

embeddings.js's Introduction

embeddings.js

Word embeddings for the the web

Blog post: https://mb-14.github.io/tech/2019/02/19/word-embeddings-js.html

Word embeddings often require a large number of parameters which results in a large memory and storage footprint. This makes deploying pre-trained word embeddings like fastText and GloVe in mobile and browser environments very difficult. In this project, we will compress pre-trained word vectors using simple post-processing techniques like PCA dimensionality reduction and production quantization. The resulting embeddings are significantly smaller compared to the original embeddings with no considerable drop in accuracy. The final vectors along with the helper methods to access them are bundled into a javascript library. The library uses tensorflowjs to decode the word embeddings and perform general purpose operations on it. To speed up inferencing, we set the runtime backend to wasm for accelerated CPU calculations at near native speed.

Demo

You can check out the demo of the js library on this page: https://mb-14.github.io/embeddings.js

Models

  • compressor - Module to compress pretrained word embeddings using PCA and product quantization
  • sentiment_classification - LSTM model for sentiment classifcation trained on the sentiment140 dataset

Instructions

This project uses yarn for dependencies

Run on local

yarn 
yarn run demo

You can then check all the demos at http://localhost:8080

Re-build models

yarn build

embeddings.js's People

Contributors

mb-14 avatar

Watchers

 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.