How brice-kengni-zanguim/amazon-review-classifier-fasttext-lstm works
Project Type and Purpose
• This is a lightweight machine-learning classification pipeline, implemented as a single Jupyter notebook (“Amazon Review.ipynb”).
• Purpose: load the Kaggle Amazon Fine Food Reviews dataset, embed words using FastText, train an LSTM classifier, and report accuracy (≈85% after 2 epochs).
File Structure Analysis
• Top-level files only:
• Amazon Review.ipynb – the entire data-prep, embedding, model definition, training, and evaluation code.
• README.md – high-level description and usage notes.
• LICENSE.md, .gitignore.
• No separate frontend/backend or service layers—this is a one-off experiment notebook.
Key Architectural Components
a. Data Source
– Kaggle dataset: raw CSV or JSON of Amazon reviews (ratings, text).
– Local copy or Kaggle cloud storage.
b. Data Preparation & Preprocessing
– Tokenization, cleaning (lowercasing, stop-word removal if any).
– Train/test split.
c. Embedding Layer
– FastText word vectors (pre-trained or trained on-the-fly).
d. Model Training
– LSTM network (e.g., TensorFlow/Keras or PyTorch).
– Training loop (epochs, batches).
e. Evaluation & Output
– Accuracy metrics, possibly confusion matrix.
f. Execution Environment
– Kaggle notebook runtime (CPU/GPU).
– Local Jupyter environment if run locally.
Relationships & Data Flows
Data Source → Preprocessing → Embedding Layer → LSTM Model → Evaluation/Results
• Loops around the training step to indicate multiple epochs.
Architectural Patterns & Design Principles
• Pipeline pattern: each stage feeds the next.
• Modularity: even within one notebook, separate code cells for distinct tasks.
• Reproducibility: version-controlled notebook, .gitignore for outputs.
Technologies & Libraries
• Python 3.x, Jupyter Notebook
• FastText (Facebook library or gensim wrapper)
• TensorFlow/Keras or PyTorch for LSTM
• Kaggle runtime (cloud compute)
Final Checklist
[ ] All six components (data, preprocessing, embedding, model, evaluation, environment) clearly boxed
[ ] Version info (.gitignore, LICENSE) can be footnoted to indicate reproducibility and licensing