How healer005/sentify works
Project type and purpose
• This is a Python-based full-stack “Sentify” sentiment analysis application.
• Core purpose: train and evaluate an LSTM neural network on the IMDB dataset, then optionally deploy a Flask web app for real-time review classification.
File structure
• Top-level scripts:
• data_loader.py – data ingest & preprocessing (dataset loading, tokenizing, padding)
• model.py – defines the Keras LSTM model architecture
• main.py – orchestrates training, evaluation, and saving the model to sentiment_model.h5
• app.py – Flask application, loads the saved model, exposes endpoints
• templates/ – HTML views for the Flask app (index.html, result.html)
• sentiment_model.h5 – serialized model artifact
• requirements.txt – Python dependencies
Pulling extra insights from the README
• Tech stack: Python, TensorFlow/Keras, Flask, Matplotlib
• Features: data preprocessing, model training/evaluation, optional web deployment, data visualization
• Future scope: transformer support, UI improvements
a. Main components to include
• Data Layer: IMDB dataset (local or TF-built-in)
• Preprocessing Module (data_loader.py)
• Model Training Module (model.py + main.py)
• Model Artifact Store (sentiment_model.h5)
• Service Layer: Flask API (app.py)
• Presentation Layer: HTML templates & browser UI
b. Relationships & data flow
1. Dataset → Preprocessing → Tokenized/Padded Data
2. Tokenized Data → Model Training → Trained Model file
3. Trained Model → Evaluation → Metrics/Plots
4. Optional: Training history → Visualization scripts → Charts
5. In deployment: Client Browser → HTTP → Flask API → Model → Prediction → Response → Render via templates
c. Architectural patterns & principles
• Layered modular structure: data, model, service, presentation
• Single monolithic codebase but logically separated by function
• Clear separation of concerns: data ingestion vs. training vs. serving vs. visualization
d. Key technologies & frameworks
• TensorFlow/Keras for model definition & training
• Flask for lightweight REST/API service
• Matplotlib for plotting
• Jinja2 templates for HTML rendering
Detail without overcomplicating
• Templates under “Presentation Layer.”
• Saved model artifact as the bridge between training and inference.