All Projects → JoeDoyle23 → fasttextjs

JoeDoyle23 / fasttextjs

Licence: BSD-2-Clause license
JavaScript implementation of the FastText prediction algorithm

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to fasttextjs

Fastrtext
R wrapper for fastText
Stars: ✭ 103 (+232.26%)
Mutual labels:  fasttext
Wordembeddings Elmo Fasttext Word2vec
Using pre trained word embeddings (Fasttext, Word2Vec)
Stars: ✭ 146 (+370.97%)
Mutual labels:  fasttext
Shallowlearn
An experiment about re-implementing supervised learning models based on shallow neural network approaches (e.g. fastText) with some additional exclusive features and nice API. Written in Python and fully compatible with Scikit-learn.
Stars: ✭ 196 (+532.26%)
Mutual labels:  fasttext
Nlp
兜哥出品 <一本开源的NLP入门书籍>
Stars: ✭ 1,677 (+5309.68%)
Mutual labels:  fasttext
Nlp research
NLP research:基于tensorflow的nlp深度学习项目,支持文本分类/句子匹配/序列标注/文本生成 四大任务
Stars: ✭ 141 (+354.84%)
Mutual labels:  fasttext
Embedding As Service
One-Stop Solution to encode sentence to fixed length vectors from various embedding techniques
Stars: ✭ 151 (+387.1%)
Mutual labels:  fasttext
Nlp Journey
Documents, papers and codes related to Natural Language Processing, including Topic Model, Word Embedding, Named Entity Recognition, Text Classificatin, Text Generation, Text Similarity, Machine Translation),etc. All codes are implemented intensorflow 2.0.
Stars: ✭ 1,290 (+4061.29%)
Mutual labels:  fasttext
Pytorch Sentiment Analysis
Tutorials on getting started with PyTorch and TorchText for sentiment analysis.
Stars: ✭ 3,209 (+10251.61%)
Mutual labels:  fasttext
Text Classification Demos
Neural models for Text Classification in Tensorflow, such as cnn, dpcnn, fasttext, bert ...
Stars: ✭ 144 (+364.52%)
Mutual labels:  fasttext
Sentence Classification
Sentence Classifications with Neural Networks
Stars: ✭ 177 (+470.97%)
Mutual labels:  fasttext
Cvtk
CVTK, a Computer Vision ToolKit.
Stars: ✭ 119 (+283.87%)
Mutual labels:  fasttext
Whatthelang
Lightning Fast Language Prediction 🚀
Stars: ✭ 130 (+319.35%)
Mutual labels:  fasttext
Gensim
Topic Modelling for Humans
Stars: ✭ 12,763 (+41070.97%)
Mutual labels:  fasttext
Magnitude
A fast, efficient universal vector embedding utility package.
Stars: ✭ 1,394 (+4396.77%)
Mutual labels:  fasttext
Cw2vec
cw2vec: Learning Chinese Word Embeddings with Stroke n-gram Information
Stars: ✭ 224 (+622.58%)
Mutual labels:  fasttext
Half Size
Code for "Effective Dimensionality Reduction for Word Embeddings".
Stars: ✭ 89 (+187.1%)
Mutual labels:  fasttext
Fasttext4j
Implementing Facebook's FastText with java
Stars: ✭ 148 (+377.42%)
Mutual labels:  fasttext
Ai law
all kinds of baseline models for long text classificaiton( text categorization)
Stars: ✭ 243 (+683.87%)
Mutual labels:  fasttext
Pyfasttext
Yet another Python binding for fastText
Stars: ✭ 229 (+638.71%)
Mutual labels:  fasttext
Wordvectors
Pre-trained word vectors of 30+ languages
Stars: ✭ 2,043 (+6490.32%)
Mutual labels:  fasttext

fasttextJS

A JavaScript implementation of the FastText prediction algorithm

The goal is to provide a compatible predict and predict-prob with the C++ version of FastText for use in Node.js.

FastText

FastText is a project out of Facebook Research. The primary implementation can be found at https://github.com/facebookresearch/fastText. That is the source code used to create this version.

Purpose of this code

This code is an experiment to see how fast a pure JavaScript implimentation could be. I envision that a modified version of the original C++ compliled to WebAssembly will be the most performant while having the best interoperability with Node.js.

The original FastText C++ version allows for both the creation of the model via training, as well as the ability to use that model for predictions. This implimentaion is currently only focused on the prediction side of FastText. With that in mind, it is compatible with models generated by the C++ version.

As much as I love Node and JavaScript, I don't see much value in implimenting the training code as the original is multithreaded and the performance will never be matched.

Status

Initial testing with our pretrained models is showing results that are very close to the C++ version. I'm still working through the code to see if I missed something in the port.

I also haven't started preformance tuning the code yet. There are many places for optimizations and doing things the JavaScript way instead of the C++ way.

This is still in progress, but I'd be curious to hear of other's experiences with it.

Limitations

Several of the values stored in the model file are 64-bit integers, so JavaScript limits apply (max values of 2^53 - 1). Models that are larger than that will probably fail to work correctly.

Currently this code only loads the "compressed" model format (.ftz).

Sample Model

You can find sample models on the FastText website. The one in the test.js file is the compressed Amazon Review Full which can be found at https://fasttext.cc/docs/en/supervised-models.html#content

License

fasttextJS is BSD-licensed just like the original source. I can only assume that the patent clause also applies to this port.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].