A premium, production-ready Financial Sentiment Analysis web application with real-time multi-dimensional sentiment tracking for stock market intelligence.
- Multi-Model AI: FinBERT sentiment analysis + emotion detection
- Voice Input: Speak stock tickers using Web Speech API
- Real-Time Data: Live news from News API and stock prices from Yahoo Finance
- Interactive Dashboards:
- Overall Sentiment Gauge
- Timeline Charts (Sentiment + Price correlation)
- Multi-dimensional Radar Charts
- Source Comparison
- Calendar Heatmap
- Correlation Scatter Plots
- AI-Generated Insights
- Dark/Light Theme: Smooth theme transitions with localStorage persistence
- Responsive Design: Works perfectly on mobile, tablet, and desktop
- Accessibility: WCAG 2.1 AA compliant
- Performance Optimized: Lazy loading, code splitting, memoization
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- pip (Python package manager)
npm installcd backend
pip install -r requirements.txtThe backend uses:
- FinBERT for financial sentiment analysis
- yfinance for stock price data
- News API for real-time news articles
- Transformers for emotion detection
To use this application, you'll need to obtain free API keys from:
- News API - Get your free key at https://newsapi.org/
- Alpha Vantage - Get your free key at https://www.alphavantage.co/support/#api-key
- Hugging Face - Get your token at https://huggingface.co/settings/tokens
- Indian Stock API - Get your key at https://indianapi.in/
-
Copy the example environment file:
cd backend cp .env.example .env -
Edit the
.envfile and add your API keys:NEWS_API_KEY=your_newsapi_key_here ALPHA_VANTAGE_KEY=your_alphavantage_key_here HF_API_KEY=your_huggingface_key_here INDIAN_STOCK_API_KEY=your_indian_stock_api_key_here
Note: The .env file is gitignored and will not be committed to the repository for security.
Terminal 1 - Start Backend:
cd backend
python app.pyThe backend will start on http://localhost:5000
Terminal 2 - Start Frontend:
npm run devThe frontend will start on http://localhost:3000
# Windows PowerShell
.\start.ps1Or use the start script from package.json:
npm start- Enter a Stock Ticker: Type a ticker symbol (e.g., AAPL, TSLA, GOOGL) or use voice input
- Select Time Period: Choose 24 Hours, 7 Days, or 30 Days
- Click Analyze: The app will fetch news and perform sentiment analysis
- Explore Results:
- View overall sentiment score
- Analyze sentiment trends over time
- Compare different news sources
- Read AI-generated insights
- Export reports
/- Focus search inputD- Toggle dark/light modeV- Activate voice inputEsc- Close modals
- React 18 with TypeScript
- Tailwind CSS for styling
- Framer Motion for animations
- Recharts for charts and graphs
- Lucide React for icons
- Zustand for state management
- Axios for API calls
- Flask for REST API
- FinBERT (ProsusAI/finbert) for financial sentiment
- Transformers for emotion detection
- yfinance for stock data
- News API for news articles
- NumPy for data processing
Analyze sentiment for a stock ticker.
Request:
{
"ticker": "AAPL",
"days": 7
}Response:
{
"ticker": "AAPL",
"companyName": "Apple Inc.",
"overallScore": 67.5,
"confidence": 89,
"totalArticles": 247,
"timeline": [...],
"dimensions": {...},
"sourceBreakdown": [...],
"headlines": [...],
"insights": {...}
}Health check endpoint.
nlp/
├── backend/
│ ├── app.py # Flask API server
│ └── requirements.txt # Python dependencies
├── src/
│ ├── components/
│ │ ├── Header.tsx
│ │ ├── Hero.tsx
│ │ ├── Dashboard.tsx
│ │ ├── Footer.tsx
│ │ └── dashboard/
│ │ ├── SearchSection.tsx
│ │ ├── OverallSentimentGauge.tsx
│ │ ├── TimelineChart.tsx
│ │ ├── RadarChart.tsx
│ │ ├── SourceComparison.tsx
│ │ ├── HeadlinesFeed.tsx
│ │ ├── CalendarHeatmap.tsx
│ │ ├── AIInsights.tsx
│ │ ├── ExportPanel.tsx
│ │ └── CorrelationScatter.tsx
│ ├── store/
│ │ └── useStore.ts # Zustand state management
│ ├── types/
│ │ └── index.ts # TypeScript types
│ ├── App.tsx
│ ├── main.tsx
│ └── index.css
├── package.json
├── tsconfig.json
├── vite.config.ts
├── tailwind.config.js
└── README.md
- Real-time sentiment scoring (-100 to +100)
- Multi-dimensional analysis (6 metrics)
- Confidence levels for each prediction
- Emotion detection (joy, fear, anger, surprise, etc.)
- Interactive timeline charts
- Radar charts for multi-dimensional view
- Source comparison bar charts
- Calendar heatmaps
- Correlation scatter plots
- Uses Web Speech API
- Real-time transcription
- Ticker confirmation dialog
- Automated trend analysis
- Correlation calculations
- Volatility assessment
- Key topics extraction
- Prediction indicators
Problem: Module not found errors
cd backend
pip install -r requirements.txt --upgradeProblem: FinBERT model download is slow
- The first run will download the FinBERT model (~450MB)
- Subsequent runs will use the cached model
- Ensure stable internet connection
Problem: Dependencies not installed
rm -rf node_modules package-lock.json
npm installProblem: Port 3000 already in use
- Change port in
vite.config.ts:
server: {
port: 3001, // Use different port
}Problem: Voice input not working
- Ensure you're using Chrome, Edge, or Safari
- Allow microphone permissions
- Check browser console for errors
This project was created for NLP Academic Evaluation and demonstrates:
-
Natural Language Processing:
- Sentiment analysis using FinBERT
- Emotion classification
- Text preprocessing
-
Machine Learning:
- Transfer learning with pre-trained models
- Multi-class classification
- Confidence scoring
-
Data Visualization:
- Interactive charts
- Real-time updates
- Responsive design
-
Full-Stack Development:
- RESTful API design
- State management
- Performance optimization
Created for academic purposes. All rights reserved.
- ProsusAI for FinBERT model
- Hugging Face for Transformers library
- News API for news data
- Yahoo Finance for stock data
For questions or issues, please contact the development team.
Made with ❤️ and AI
FinSentiment Pro - Empowering financial decisions with AI-powered sentiment analysis