File size: 1,782 Bytes
fe9be30
14eed51
fe9be30
 
 
 
 
 
14eed51
33c14bd
 
 
 
fe9be30
14eed51
 
fe9be30
 
33c14bd
fe9be30
33c14bd
fe9be30
33c14bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47d83ad
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: Finbert Market Evaluation
emoji: 🚀
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
- finbert
- sentiment-analysis
- finance
- machine-learning
pinned: false
short_description: Evaluate FinBERT’s sentiment predictions against market data
license: mit
---

# 🚀 FinBERT Market Evaluation

Evaluate how well FinBERT's financial sentiment predictions match actual stock market movements.

## What It Does

Enter financial news → Get FinBERT sentiment → Compare with actual stock price movement → See if the prediction was right.

## How to Use

1. **Paste financial news** (e.g., "Apple reports record earnings")
2. **Enter stock ticker** (e.g., AAPL)
3. **Select news date** (when the news was published)
4. **Get results** - see if sentiment matched price movement

## Key Features

- **Smart thresholds** - Uses each stock's volatility (no rigid ±1% rules)
- **Same-day + 24h analysis** - Immediate reaction + follow-through
- **Graded scoring** - Not just right/wrong, but how right (0-1 score)
- **Market context** - Compares stock vs overall market performance

## Example

**News**: "Tesla announces new factory in Germany"
- **FinBERT says**: Positive sentiment (85% confidence)
- **Stock moved**: +4.2% same day
- **Evaluation**: ✅ Aligned (sentiment matched direction)
- **Score**: 0.91/1.0 (excellent alignment)

## Installation

```bash
pip install -r requirements.txt
streamlit run src/streamlit_app.py
```

## Limitations

- Research tool only (not for trading)
- 30-second rate limit between requests
- Needs 1+ day old news (requires market data)
- Uses Yahoo Finance (free but limited)


# Build the Docker image
docker build -t finbert-market-eval .

# Run locally to test
docker run -p 8501:8501 finbert-market-eval