YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
An NLI-Based Approach to Asset-Specific Stance Detection in Cryptocurrency Tweets
This model classifies the stance of tweets toward Bitcoin (BTC) and Ethereum (ETH) as Bullish, Bearish, or Neutral using standard 3-class classification.
It was fine-tuned from ProsusAI/finbert as part of a master's thesis on NLI-based cryptocurrency stance detection.
How it works
Unlike the NLI models in this project, FinBERT uses direct 3-class classification. The existing sentiment head (positive/negative/neutral) is fine-tuned for stance detection (Bullish/Bearish/Neutral). Input is formatted as "{target} [SEP] {preprocessed_text}" to make the model target-aware.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "syahrezapratama/finbert-crypto-stance"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
tweet = "BTC [SEP] Bitcoin is going to the moon! $100k is just the beginning"
inputs = tokenizer(tweet, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)
labels = {0: "Bearish", 1: "Neutral", 2: "Bullish"}
predicted = labels[torch.argmax(probs, dim=-1).item()]
print(f"Predicted stance: {predicted}")
Performance
Evaluated on a held-out test set of 450 tweets (70/15/15 train/val/test split, seed=42).
Overall metrics
| Metric | Value |
|---|---|
| Accuracy | 71.78% |
| Macro F1 | 0.6730 |
| Weighted F1 | 0.7230 |
Per-class metrics
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| Bearish | 0.6042 | 0.6170 | 0.6105 | 47 |
| Neutral | 0.8374 | 0.7574 | 0.7954 | 272 |
| Bullish | 0.5641 | 0.6718 | 0.6132 | 131 |
Comparison with baselines
| Model | Paradigm | Accuracy | Macro F1 |
|---|---|---|---|
| FinBERT | Zero-Shot | 58.44% | 0.3543 |
| FinBERT | Fine-Tuned | 71.78% | 0.6730 |
| GPT-4o | Zero-Shot | 76.67% | 0.7275 |
Training details
Dataset
- Source: 3,000 cryptocurrency tweets about BTC and ETH
- Labels: Bullish (873), Neutral (1,814), Bearish (313)
- Split: 2,099 train / 451 val / 450 test (seed=42)
Hyperparameters
| Parameter | Value |
|---|---|
| Base model | ProsusAI/finbert |
| Paradigm | 3-class classification |
| Learning rate | 2e-5 |
| Batch size | 16 |
| Max epochs | 5 (early stopping patience = 3) |
| Max sequence length | 128 |
| Warmup | 10% linear warmup + linear decay |
| Weight decay | 0.01 |
| Class weights | Bearish=3.19, Neutral=0.55, Bullish=1.15 |
| Optimizer | AdamW |
| Best epoch | Early stopped based on validation macro F1 |
Limitations
- Domain-specific: Trained only on cryptocurrency tweets (BTC and ETH). May not generalize to other financial assets or domains.
- Class imbalance: Bearish tweets are underrepresented (10.4% of data), leading to lower recall on bearish stance despite class weighting.
- Language: English only.
- Temporal: Trained on tweets from a specific time period. Cryptocurrency language and sentiment patterns evolve rapidly.
Citation
If you use this model, please cite:
@mastersthesis{pratama2026cryptostancenli,
title={An NLI-Based Approach to Asset-Specific Stance Detection in Cryptocurrency Tweets},
author={Pratama, Syahreza},
year={2026},
}
License
MIT
- Downloads last month
- 45