mobadara's picture
Sync from GitHub via hub-sync
c66b19a verified
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


πŸ—οΈ 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.

  1. Base Model: ProsusAI/finbert
  2. Fine-tuning: Conducted in Google Colab using a T4 GPU.
  3. Training Data: The Kaggle Financial PhraseBank dataset. (Check the /notebooks directory 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

LinkedIn X / Twitter Portfolio