Downloads · 30 days
0
stocky-ai/stock-predictor-scratch
stock-predictor-scratch is a machine learning model from stocky-ai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
language: - en - tr tags: - finance - stocks - news-analysis - stock-prediction - information-retrieval license: apache-2.0 datasets: - financial-news metrics: - recall pipelinetag: zero-shot-classification ---
Downloads · 30 days
0
Access
Public
Updated Feb 7, 2026
Repo size
1.4 GB
Likes
1
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
language:
Predict stock symbols from news headlines using a two-stage deep learning pipeline.
This model predicts which stock symbols are mentioned or relevant to a given news headline. It uses a sophisticated two-stage retrieval system:
Test Set Metrics (10,620 samples):
Real-World Performance:
from predict import StockyPredictor
# Initialize predictor
predictor = StockyPredictor()
# Your list of stock symbols (load all 6,973 stocks in production)
stocks = ["NVDA", "AAPL", "MSFT", "GOOGL", "AMZN", "TSLA", "META", ...]
# Predict
title = "Nvidia announces new AI chip breakthrough"
predictions = predictor.predict(title, stocks, top_k=10)
# Results: [('NVDA', 0.95), ('AMD', 0.78), ...]
for stock, score in predictions:
print(f"{stock}: {score:.4f}")
Tokenizer (35K vocab)
MLM Pretrained Encoder (113M params)
Contrastive Model (226M params)
Cross-Encoder Reranker (113M params)
title = "Apple unveils new iPhone with advanced camera"
predictions = predictor.predict(title, all_stocks)
# Top result: AAPL (0.94)
title = "Bitcoin price surges past $50,000"
predictions = predictor.predict(title, all_stocks)
# Top result: BTC-USD (0.92)
title = "Tech giants report strong earnings amid AI boom"
predictions = predictor.predict(title, all_stocks)
# Top results: NVDA (0.89), MSFT (0.85), GOOGL (0.78)
# Load your own stock universe
import pandas as pd
stocks_df = pd.read_csv("my_stocks.csv")
stocks = stocks_df["symbol"].tolist()
predictions = predictor.predict(title, stocks, top_k=20)
news_headlines = [
"Nvidia announces new GPU",
"Tesla deliveries beat estimates",
"Amazon expands AWS services"
]
all_predictions = []
for headline in news_headlines:
preds = predictor.predict(headline, all_stocks)
all_predictions.append({
"headline": headline,
"predictions": preds
})
# Retrieve more candidates for better recall
predictions = predictor.predict(
title,
all_stocks,
top_k=10,
candidates_k=100 # Default: 50
)
| Component | Size | Description |
|---|---|---|
| Tokenizer | 35K vocab | Financial domain tokenizer |
| Title Encoder | 113M | Encodes news headlines |
| Stock Encoder | 113M | Encodes stock symbols |
| Reranker | 113M | Scores title-stock pairs |
| Total | ~340M params | Complete pipeline |
@misc{stocky2025,
title={Stocky: Stock Prediction from News Headlines},
author={Stocky AI Team},
year={2025},
publisher={Hugging Face},
howpublished={\\url{https://huggingface.co/stocky-ai/stocky-stock-predictor}}
}
Apache 2.0
Built with ❤️ using PyTorch and Transformers