Spaces:
Running
Running
metadata
title: FinBERT Sentiment Analyzer API
emoji: π
colorFrom: blue
colorTo: gray
sdk: docker
pinned: false
π FinBERT: Real-Time Financial Sentiment Analysis
Machine Learning Pipeline, which analyses news headlines about finance and forecasts sentiments (Bullish, Bearish, and Neutral).
The project will train a BERT-based model with PyTorch, implement API prediction requests using FastAPI, and display visualization results on a React-Bootstrap web interface.
π Project Links
- Live Application: Link
- Frontend Code: Github
- Project Blog Post: Link
- Model Weights (Optional): Hugging Face mobadara/finbert-finetuned
ποΈ System Architecture
- Machine Learning: PyTorch, Hugging Face
transformers, Financial PhraseBank Dataset - Backend API: Python, FastAPI, Uvicorn
- Frontend UI: React, React-Bootstrap
- Database: PostgreSQL (Neon/Supabase) via SQLAlchemy
π§ The Machine Learning Pipeline
The core of this application is a fine-tuned NLP model.
- Base Model:
ProsusAI/finbert - Fine-tuning: Conducted in Google Colab using a T4 GPU.
- Training Data: The Kaggle Financial PhraseBank dataset.
(Check the
/notebooksdirectory to see the complete PyTorch training loop, tokenization process, and evaluation metrics).
π How to Run Locally
1. Clone the Repository
copy the command below and run it in your favourite terminal.
git clone https://github.com/mobadara/finbert-sentiment-analyzer-api &&
cd finbert-sentiment-analyzer-api.git
2. Create a virtual environment
python -m venv venv
3. Activate the virtual environment
a. On Linux/Mac
source venv/bin/activate
b. On Windows
venv\Scripts\activate
4. Install Dependencies
pip install -r requirements.txt
5. Start the server
uvicorn app.main:app --reload
π¨βπ» Author:
Muyiwa J. Obadara