SentiGrade is a scalable microservice for sentiment classification (Positive, Negative, Neutral). It implements a Dual-Model Architecture allowing runtime switching between:
- Baseline: TF-IDF + Logistic Regression (Low Latency).
- SOTA: DistilBERT Transformer (High Accuracy).
# Clone the repository
git clone https://github.com/Eatosin/SentiGrade.git
cd SentiGrade
# Install dependencies
pip install -r requirements.txt# Start the FastAPI server
python src/main.pyAccess documentation at http://localhost:8000/docs
# Build and launch the container
docker-compose up --build- Accuracy: 59%
- F1-Score: 0.58
- Status: Included in repo.
- Accuracy: 69.5%
- F1-Score: 0.70
- Status: Available via external download (see models/DOWNLOAD_INSTRUCTIONS.md).
I have implemented a comprehensive test suite using Pytest and FastAPI TestClient. The tests include mocking of the transformer models to allow for rapid CI/CD execution without heavy hardware.
Run the tests:
python -m pytest tests/ -vQuality Standards:
- Type Safety: 100% Type Hinting coverage (Checked via MyPy).
- Logging: Production-grade structured logging for request traceability.
- Validation: Pydantic models for all Request/Response payloads
Owadokun Tosin Tobi Senior AI Engineer