How debopriya-ai/feel-the-words works
Project type and purpose
• This is an NLP research/demo pipeline contained in a single Jupyter notebook.
• Purpose: perform precision sentiment classification on the IMDB dataset using two parallel model paths:
a) a fully custom PyTorch RNN built from scratch, and
b) a fine-tuned fastai AWD_LSTM.
• Emphasis on manual hidden-state handling, dropout regularization, tokenization, custom data loaders, and transfer learning.
File structure
• Top level has only a single notebook (RNN_NLP_LAB (1).ipynb), plus LICENSE and README.
• All code, data ingestion, preprocessing, model definitions, training loops, and evaluation live inside that notebook.
• No separate “src” or “config” directories—everything is modularized in notebook cells.
Extract key architecture details from the README
• Two modeling “paths”: handcrafted RNN vs. fastai AWD_LSTM.
• Shared preprocessing: tokenization, numericalization, batching via custom loader.
• Shared evaluation metrics and comparison stage.
• Tech stack: Python + Jupyter, PyTorch, fastai, IMDB dataset.
Main components
A. Data Source
• IMDB raw text dataset (probably loaded via fastai’s DataBlock or custom Pandas loader).
B. Preprocessing Module
• Tokenizer & numericalizer
• Custom PyTorch DataLoader with dropout at the batch level
C. Dual Modeling Pipelines
1. Custom PyTorch RNN
– RNN cell architecture (embedding → recurrent layers → linear classifier)
– Manual hidden-state initialization & dropout between steps
– Training loop (loss computation, backprop)
2. fastai AWD_LSTM
– Pretrained language model head
– Fine-tuning strategy (gradual unfreezing, discriminative learning rates)
– fastai Learner wrapper for training & callbacks
D. Evaluation & Comparison
– Accuracy computation for each model
– Visualization of training/validation curves
– Final performance table (92.3% vs. 85.1%)
Relationships and data flow
• From Evaluation → Results & Visualization.
Architectural patterns and design principles
• Dual-path architecture facilitates direct compare/contrast.
• Reuse of preprocessing logic to ensure fair comparison.
• Separation of concerns: data ingestion, preprocessing, modeling, evaluation.
• Transfer learning vs. from-scratch modeling side by side.
Technologies & libraries to annotate
• Python / Jupyter environment (outer container)
• fastai (AWD_LSTM path)
• PyTorch core (custom RNN path)
• IMDB dataset source (could note Hugging Face or local CSV)
• Custom DataLoader (dropout, batching)