GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TensorLayer/examples/text_classification at master · tensorlayer/TensorLayer

Expand file tree

/

text_classification

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

text_classification

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
readme.md
readme.md
 
 
tutorial_imdb_fasttext.py
tutorial_imdb_fasttext.py
 
 

readme.md

Outline

Introduction

The demos implement FastText[1] for sentence classification.

Code: tutorial_imdb_fasttext.py

FastText is a simple model for text classification with performance often close to state-of-the-art, and is useful as a solid baseline.

There are some important differences between this implementation and what is described in the paper. Instead of Hogwild! SGD[2], we use Adam optimizer with mini-batches. Hierarchical softmax is also not supported; if you have a large label space, consider utilizing candidate sampling methods provided by TensorFlow[3].

After 5 epochs, you should get test accuracy around 90.3%.

References

[1] Joulin, A., Grave, E., Bojanowski, P., & Mikolov, T. (2016). Bag of Tricks for Efficient Text Classification. http://arxiv.org/abs/1607.01759

[2] Recht, B., Re, C., Wright, S., & Niu, F. (2011). Hogwild: A Lock-Free Approach to Parallelizing Stochastic Gradient Descent. In Advances in Neural Information Processing Systems 24 (pp. 693–701).

[3] https://www.tensorflow.org/api_guides/python/nn#Candidate_Sampling

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.