Kenpache/flame2
FLAME2 — Financial Language Analysis for Multilingual Economics v2
One model. Ten languages. 150,000 headlines. Perspective-aware financial sentiment.
FLAME2 is a multilingual financial sentiment classifier that labels news headlines as Negative, Neutral, or Positive — but unlike other models, it does this from the local investor's perspective of each economy.
The same news can mean opposite things for different markets:
- "Oil prices fall to $65/barrel" → Negative for Arab markets (oil exporter) / Positive for India (oil importer)
- "Yen weakens to 155 per dollar" → Positive for Japan (helps exporters) / Neutral elsewhere
No other public model does this.
Key Numbers
Quick Start
from transformers import pipeline
classifier = pipeline("text-classification", model="Kenpache/flame2")
# English — US investor perspective
classifier("[EN] Apple reported record quarterly revenue of $124 billion")
# [{'label': 'positive', 'score': 0.96}]
# Arabic — Gulf investor perspective
classifier("[AR] أسعار النفط تنخفض إلى 65 دولارا للبرميل")
# [{'label': 'negative', 'score': 0.93}] (oil down = bad for exporters)
# Hindi — Indian investor perspective
classifier("[HI] तेल की कीमतें गिरकर 65 डॉलर प्रति बैरल हुईं")
# [{'label': 'positive', 'score': 0.91}] (oil down = good for importers)
# Japanese
classifier("[JA] 日経平均株価が大幅下落、米中貿易摩擦の懸念で")
# [{'label': 'negative', 'score': 0.94}]
# Korean
classifier("[KO] 삼성전자 실적 호조에 코스피 상승")
# [{'label': 'positive', 'score': 0.92}]
# Chinese
classifier("[ZH] 中国央行降息50个基点,股市应声上涨")
# [{'label': 'positive', 'score': 0.95}]
# German
classifier("[DE] DAX erreicht neues Allzeithoch dank starker Bankenergebnisse")
# [{'label': 'positive', 'score': 0.93}]
# French
classifier("[FR] La Bourse de Paris chute de 3% après les tensions commerciales")
# [{'label': 'negative', 'score': 0.91}]
# Spanish
classifier("[ES] El beneficio neto de la compañía creció un 25% interanual")
# [{'label': 'positive', 'score': 0.94}]
# Portuguese
classifier("[PT] Ibovespa fecha em alta com otimismo sobre reforma tributária")
# [{'label': 'positive', 'score': 0.90}]Important: Always use the [LANG] prefix ([EN], [AR], [HI], [JA], etc.) — this tells the model which market perspective to apply.
Supported Languages & Training Data
Total: 149,481 labeled headlines across 10 languages.
Overall Class Distribution
Data sources include financial news sites, stock market reports, and economic news agencies — labeled with perspective-aware rules specific to each economy.
What Makes FLAME2 Different
The Problem
Existing financial sentiment models treat sentiment as universal. But financial sentiment is not universal — it depends on where you are:
- Oil prices drop? Bad for Saudi Arabia, great for India.
- Yen weakens? Good for Japanese exporters, bad for Korean competitors.
- Fed raises rates? Bad for US stocks, often neutral for European markets.
Our Solution: Perspective-Aware Labels
Every headline in our dataset was labeled from the perspective of a local investor in that language's primary economy. The model learns that [AR] means "Gulf investor" and [HI] means "Indian investor."
Oil Price Rules
Currency Rules
Central Bank Rules
- Home central bank: rate cut = Positive, rate hike = Negative, hold = Neutral
- Foreign central bank: Neutral (unless headline explicitly links to local market impact)
Labels
Results
Overall
Per-Language Performance
Per-Class Performance
Training Pipeline
FLAME2 was built in two stages:
Stage 1: Supervised Fine-Tuning
XLM-RoBERTa-large was fine-tuned on ~150,000 perspective-labeled headlines with:
- Focal Loss (gamma=2.0) — focuses training on hard, misclassified examples instead of easy ones
- Class weights to handle label imbalance across languages
- Label smoothing (0.1) to handle ~3-5% annotation noise
- Language prefix
[LANG]injected before each headline for perspective routing - GroupShuffleSplit by news source domain — no article from the same source appears in both train and test (prevents data leakage)
- Gradient clipping (max_norm=1.0) for training stability
Stage 2: Live Stochastic Weight Averaging (SWA)
After epoch 12, the learning rate switches to a constant low rate (1e-5) and an AveragedModel maintains a running average of weights updated every epoch. This produces smoother, more generalizable predictions than any single checkpoint.
Training Details
Batch Processing
from transformers import pipeline
classifier = pipeline("text-classification", model="Kenpache/flame2", device=0)
texts = [
"[EN] Stocks rallied after the Fed signaled a pause in rate hikes.",
"[EN] The company filed for Chapter 11 bankruptcy protection.",
"[DE] DAX erreicht neues Allzeithoch dank starker Bankenergebnisse",
"[FR] La Bourse de Paris chute de 3% après les tensions commerciales",
"[ES] El beneficio neto de la compañía creció un 25% interanual",
"[ZH] 中国央行降息50个基点,股市应声上涨",
"[PT] Ibovespa fecha em alta com otimismo sobre reforma tributária",
"[AR] ارتفاع مؤشر السوق السعودي بنسبة 2% بعد إعلان أرباح أرامكو",
"[HI] भारतीय रिजर्व बैंक ने रेपो रेट में 25 बीपीएस की कटौती की",
"[JA] トヨタ自動車の純利益が前年比30%増加",
"[KO] 삼성전자 실적 호조에 코스피 상승",
]
results = classifier(texts, batch_size=32)
for text, result in zip(texts, results):
print(f"{result['label']:>8} ({result['score']:.2f}) {text[:70]}")Use Cases
- Global News Monitoring — real-time sentiment classification across 10 markets
- Algorithmic Trading — perspective-aware signals: same event, different trades per market
- Portfolio Risk Management — track sentiment shifts across international holdings
- Cross-Market Arbitrage — detect when markets react differently to the same news
- Financial NLP Research — first multilingual perspective-aware sentiment benchmark
Limitations
- Optimized for news headlines (short text, 1-2 sentences). May underperform on long articles or social media.
- Perspective rules cover major economic patterns (oil, currency, central banks). Niche sector-specific effects may not be captured.
- Labels reflect the perspective of the primary economy for each language (e.g., AR = Gulf States, not all Arabic-speaking countries).
Citation
@misc{flame2_2026,
title={FLAME2: Financial Language Analysis for Multilingual Economics v2},
author={Kenpache},
year={2026},
url={https://huggingface.co/Kenpache/flame2}
}License
Apache 2.0
