How khemanth630/stockgen works
StockGEN combines a Streamlit forecasting interface and a Flask prediction API. The main workflow gathers historical prices and news, merges them, scores news sentiment, computes volatility, predicts price and trend, then generates confidence and a Buy/Sell/Hold recommendation. The interface also offers a separate retrieval-based question-answering path over the generated sentiment-and-volatility CSV. The excerpts show the API orchestration and key dataset routines; some implementation details are omitted, so only evidenced integrations and calls are drawn.
Main entry points: app.py Streamlit App · api.py Prediction API · dataset_app.py Price & News · finetuned_lora_model_confidence Confidence Model
Components 19
User Interface
- Streamlit App
app.py - Prediction API
api.py - Forecast Result
api.py
Market Data
- Price & News
dataset_app.py - Yahoo Finance
- Alpaca News
- Merged Data
Forecasting
- FinBERT Sentiment
api.py - Volatility Scoring
api.py - Price Forecast
api.py - Confidence Model
finetuned_lora_model_confidence - Recommendation Model
finetuned_lora_model_recommendation
Stock Q&A
- Sentiment CSV
- Row Retrieval
app.py - Answer Generation
app.py - Flan-T5 Model
- Sentence Embedder
- FAISS Index
app.py
Other components
- Investor
Connections 22
- Investor → Streamlit App: enters inputs
- Streamlit App → Prediction API: POSTs prediction
- Prediction API → Price & News: calls fetch and merge
- Price & News → Yahoo Finance: fetches prices
- Price & News → Alpaca News: fetches news
- Price & News → Merged Data: returns merged data
- Prediction API → FinBERT Sentiment: scores news
- FinBERT Sentiment → Volatility Scoring: adds sentiment scores
- Volatility Scoring → Price Forecast: provides features
- Price Forecast → Confidence Model: supplies trend
- Price Forecast → Recommendation Model: supplies forecast
- Confidence Model → Recommendation Model: supplies confidence
- Prediction API → Forecast Result: returns prediction
- Forecast Result → Streamlit App: renders metrics
- Investor → Streamlit App: asks question
- Streamlit App → Sentiment CSV: reads generated data
- Sentiment CSV → Row Retrieval: provides rows
- Row Retrieval → Sentence Embedder: embeds rows and query
- Row Retrieval → FAISS Index: indexes and searches
- Row Retrieval → Answer Generation: provides context
- Answer Generation → Flan-T5 Model: generates answer
- Answer Generation → Streamlit App: displays response