Giter Club home page Giter Club logo

multi-label_text_classification_for_household_grocery_items's Introduction

.py Files:

preprocessing.py

  • It converts the labels in training data in one hot encoding
  • Splits the train_data into train.csv and validation.csv and saves the csvs in the Data folder

dataloader.py –

  • I have used torchtext to tokenize the titles, creating the vocabulary and creating the trainloader, validationloader and testloader

model.py –

  • It contain the Bi-lstm network architecture

train_and_save.py –

  • This script is used for training the network and then saving the checkpoints of the network

test.py –

  • This script is used to test the network on the unseen data.
  • In the Results folder -> test_results.csv is generated using test.py ( Data used is test.csv which is saved inside Data folder )

Model Used:

  • I attempted to solve the multi-label classification problem using 2 layer Bi-LSTM . ( For the full network configuration see model.py)
  • For the Loss Function I have used BCEWithLogitsLoss
  • Optimizer used : Adam

Final Loss after 12 Epoches of training:

Training Loss: 0.0049 Validation Loss: 0.0028

Model_Checkpoints folder contains the weight files. Final result csv is saved in the Results folder -> test_results.csv. It contains the titles and probability scores for each of the labels.

Packages Used:

PyTorch, Sklearn, Torchtext, Pandas, Numpy

multi-label_text_classification_for_household_grocery_items's People

Contributors

ankancode avatar

Watchers

James Cloos 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.