Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.16 KB

README.md

File metadata and controls

67 lines (47 loc) · 2.16 KB

Financial Sentiment Analyzer with FinBERT

A Gradio-powered web application that performs sentiment analysis on financial headlines using FinBERT. The app classifies headlines as positive, negative, or neutral, making it useful for financial market sentiment analysis.

Features

  • Custom Input Analysis: Analyze your own financial headlines or news snippets

ezgif-2-ff46e6894c

  • Yahoo Finance Integration: Automatically fetch and analyze latest headlines from Yahoo Finance RSS feeds

chrome-capture-yahoo

  • Color-Coded Results: Easy-to-interpret sentiment results with visual indicators
    • 🟢 Green for positive sentiment
    • 🔴 Red for negative sentiment
    • ⚪ Gray for neutral sentiment

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Installation & Usage

  1. Clone the repository:
git clone https://github.com/kimon2199/financial-sentiment-analyzer.git
cd financial-sentiment-analyzer
  1. Install required packages:
pip3 install -r requirements.txt
  1. Log into Hugging Face:
cp .env.example .env

Add your Hugging Face token to the .env file.

  1. Start the application:
python3 -m financial_headline_analyzer.app
  1. Open your web browser and navigate to the URL provided in the terminal (typically http://127.0.0.1:7860)

  2. Use the application:

    • Enter custom headlines in the text area (one headline per line) and click "Analyze Sentiment on Custom Input"
    • Or click "Analyze Sentiment on Yahoo Finance Headlines" to fetch and analyze latest headlines

Dependencies

  • gradio - Web interface framework
  • transformers - For FinBERT model
  • torch - PyTorch for deep learning
  • pandas - Data manipulation and analysis
  • huggingface_hub - For logging into Hugging Face
  • python-dotenv - For loading environment variables from .env file

Acknowledgments

  • FinBERT for the financial sentiment analysis model
  • Gradio for the web interface framework