Coder Social home page Coder Social logo

shorttext-fasttext's Introduction

ShortText-Fasttext

ShortText classification is an intractability problem in Machine Learning. Based on Facebook's Fasttext, this project optimizes its performance in ShortText and introduces a mechanism named category dropout. This mechanism works very well in Weibo's ads classification. Details about category dropout can read Blog

Building

git clone https://github.com/AckClinkz/ShortText-Fasttext
cd ShortText-Fasttext
make

Usage

This section assumes that you are somewhat familiar with Fasttext. You can try to learn the basics of Fasttext from officical website.

Category Dropout only supports mode of supervised. Train model with category dropout, just set -cate_dropout.

In pratice, setting minCount can improve model performance. But it will lost infomation in low-frequency word. Settting vocabulary is an efficient method to balance them. If word in vocabulary, don't consider minCount.

Summarize the above points ShortText-Fasttext's usage as follows:

fasttext supervised \
  -input your_input.txt \
  -output your_model \
  -dim 120 \
  -lr 0.3 \
  -wordNgrams 3 \
  -minCount 30 \
  -bucket 10000000 \
  -epoch 100 \
  -thread 4 \
  -cate_dropout \
  -vocab ./your_vocabulary.txt

Updated 2018.11.6

According to 《Item2Vec: Neural Item Embedding for Collaborative Filtering 》, realize item2vec, usage as follow:

fasttext skipgram_item2vec \
  -input ./your_input.txt \
  -output "./your_model" \
  -dim 120 \
  -lr 0.01 \
  -wordNgrams 1 \
  -minCount 2 \
  -bucket 1000000 \
  -epoch 5 \
  -thread 8

shorttext-fasttext's People

Contributors

ackclinkz 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.