This repository contains code for a text classification project focused on an e-commerce dataset. The goal is to classify product descriptions into different categories using Natural Language Processing (NLP) techniques and machine learning models.
Ecommerce_Model.ipynb
: Jupyter Notebook containing the entire workflow from data preprocessing to model training and evaluation.Ecommerce_Model.py
: Python file containing the entire code for the model.ecommerceDataset.csv
: Dataset used for training the model.README.md
: This file, providing an overview of the project.
The dataset (ecommerceDataset.csv
) consists of two columns:
category
: Product category.text
: Product description.
- Data cleaning and preprocessing steps include handling missing values, text normalization (lowercasing), and removal of stopwords.
- The model architecture includes an Embedding layer followed by LSTM layers for sequence processing.
- Tokenization and padding are used to prepare text data for input into the model.
- The model is trained using
sparse_categorical_crossentropy
loss andAdam
optimizer. - Training progress and validation metrics (accuracy) are monitored.
- Early stopping is implemented to prevent overfitting.
To run the notebook (Ecommerce_Model.ipynb
):
- Clone the repository:
git clone https://github.com/ArkZ10/NLP-Dicoding.git
- Open the notebook in Jupyter or Google Colab and execute each cell sequentially.
You can use the trained model to predict categories for new product descriptions. Example texts are provided in the notebook for testing predictions.
Python 3 Libraries: pandas, numpy, tensorflow, keras, sklearn, nltk, seaborn, matplotlib