Giter Club home page Giter Club logo

yahoo-answers-text-classification's Introduction

Yahoo-Answers-Text-Classification

Text Classification using ULMFiT and BERT. Challenge solved for ML Fellowship program @Fellowship.ai

ULMFiT

  1. Language Model
    1. AWD-LSTM - Architecture
    1. 0.3 - Dropout
    1. 1e-2 -Learning Rate (One cycle policy with 2 epochs, to avoid overfitting)
    1. 1e-3 -Learning Rate (Unfreezing all layers)
  1. Classification Model {To train the classifier, we will use a technique called gradual unfreezing. We can start by training the last few layers, then go backwards and unfreeze and train layers before. We can use the learner function learn.freeze_to(-2) to unfreeze the last 2 layers.}
    1. AWD-LSTM - Architecture
    1. 0.5 - Dropout
    1. 1e-2 -Learning Rate(One cycle policy with 2 epochs, to avoid overfitting)
      1. (5e-3, 2e-3) -Slice Learning Rate(Unfreeze last 2 layers) {Applying different lr for different groups is a technique called “discriminative layer training”}
      1. (0.8, 0,7) -Momentum {0.8 to 0.7 during the warmup then from 0.85 to 0.95 in the annealing}
      1. (2e-3/100, 2e-3) -Slice Learning Rate(Unfreeze all the layers)
      1. (0.8, 0,7) -Momentum
    1. 64 -Batch Size

How to improve performance (ULMFiT)?

  1. Provide more data to ULTFiT language model (requires more computational resources)
  2. Hyperparameter tuning using bayesian techniques (for language model and classification model)
  3. Reduce dropout in language model (may lead to overfitting, so need to be careful)

BERT

  • 64 -Max Length
  • 64 -Batch Size
  • 2e-5 -Learning Rate
  • 3 -Epochs

How to improve performance (BERT)?

  1. Increase max length parameter (requires more computational resources)
  2. Reduce batch size (more execution time, may lead to overfitting)
  3. Use regulazation techniques (L1 and L2)

RESULTS

# Model Accuracy Loss Total Time
01 ULMFiT 0.753679 0.702299 11:06
02 BERT 0.8193 0.5698 13:06

yahoo-answers-text-classification's People

Contributors

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