CoolFace
Apppublic

paramasivan27/Product_Category_Classification_BERT

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
App README

Retail Product Classification Streamlit App

This Streamlit app is a product classification tool built using a BERT model fine-tuned on a retail product dataset. The model can classify products into one of 21 categories based on their title and description.

Dataset

The model was trained using the Kaggle Retail Product Classification dataset. The dataset consists of various product descriptions and their corresponding categories. The training goal was to classify products into 21 distinct categories.

Categories and Index Mapping

CategoryIndex
Electronics0
Sports & Outdoors1
Cell Phones & Accessories2
Automotive3
Toys & Games4
Tools & Home Improvement5
Health & Personal Care6
Beauty7
Grocery & Gourmet Food8
Office Products9
Arts, Crafts & Sewing10
Pet Supplies11
Patio, Lawn & Garden12
Clothing, Shoes & Jewelry13
Baby14
Musical Instruments15
Industrial & Scientific16
Baby Products17
Appliances18
All Beauty19
All Electronics20

Model Training

The model used for this app is a BERT base model (bert-base-uncased) fine-tuned using the Hugging Face transformers library. The model was trained to classify products into the 21 categories listed above. The fine-tuning was carried out using the following training arguments:

'''python trainingargs = TrainingArguments( outputdir='./results', evaluationstrategy='epoch', savestrategy='epoch', loggingstrategy="steps", loggingsteps=10, perdevicetrainbatchsize=32, perdeviceevalbatchsize=16, numtrainepochs=6, weightdecay=0.01, learningrate=2e-5, lrschedulertype='cosine', warmupsteps=250, loggingdir='./logs', reportto="tensorboard", loadbestmodelatend=True, savetotallimit=3, gradientaccumulationsteps=2, seed=42, evalaccumulation_steps=10, )'''

How to run the APP

Provide any Retail product title and Description in the given text boxes and click on classify product. The app would return the appropriate category