CoolFace
Modelpublic

Kenpache/flame

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes13downloads
Model Card

FLAME — Financial Language Analysis for Multilingual Economics

One model. Six languages. Real financial sentiment.

FLAME classifies financial text as Negative, Neutral, or Positive across English, Chinese, Japanese, German, French, and Spanish — in a single model, no language detection needed.

Built on XLM-RoBERTa with domain-adaptive pretraining on 35K+ financial texts, then fine-tuned on ~39K real financial news samples from 80+ sources worldwide.

Quick Start

python
from transformers import pipeline

classifier = pipeline("text-classification", model="Kenpache/flame")

# English
classifier("Apple reported record quarterly revenue of $124 billion, up 11% year over year.")
# [{'label': 'Positive', 'score': 0.96}]

# Chinese
classifier("该公司季度亏损扩大至5亿美元,远超市场预期。")
# [{'label': 'Negative', 'score': 0.94}]

# Japanese
classifier("トヨタ自動車の営業利益は前年同期比30%増の1兆円を突破した。")
# [{'label': 'Positive', 'score': 0.95}]

# German
classifier("Die Aktie verlor nach der Gewinnwarnung deutlich an Wert.")
# [{'label': 'Negative', 'score': 0.92}]

# French
classifier("Le chiffre d'affaires du groupe a progressé de 8% au premier semestre.")
# [{'label': 'Positive', 'score': 0.93}]

# Spanish
classifier("Las acciones de la empresa se mantuvieron estables tras la publicación de resultados.")
# [{'label': 'Neutral', 'score': 0.89}]

Batch Processing

python
from transformers import pipeline

classifier = pipeline("text-classification", model="Kenpache/flame", device=0)

texts = [
    "Stocks rallied after the Fed signaled a pause in rate hikes.",
    "The company filed for Chapter 11 bankruptcy protection.",
    "Q3 earnings were in line with analyst expectations.",
    "日経平均株価が3万円台を回復した。",
    "Les marchés européens ont clôturé en forte baisse.",
    "El beneficio neto de la compañía creció un 25% interanual.",
]

results = classifier(texts, batch_size=32)
for text, result in zip(texts, results):
    print(f"{result['label']:>8} ({result['score']:.2f})  {text[:70]}")

Results

MetricScore
Accuracy0.8103
F1 (weighted)0.8102
Precision (weighted)0.8111
Recall (weighted)0.8103

Per-Class Performance

ClassPrecisionRecallF1Support
Negative0.780.830.81917
Neutral0.830.790.811,779
Positive0.800.820.811,225

All three classes achieve balanced F1=0.81, even with imbalanced training data (Neutral 45%, Positive 31%, Negative 24%).

Labels

LabelIDWhat it captures
Negative0Losses, decline, bearish signals, layoffs, bankruptcy
Neutral1Factual statements, announcements, no clear sentiment
Positive2Growth, gains, bullish signals, record earnings, upgrades

Supported Languages

LanguageCodeTraining SamplesKey Sources
JapaneseJA8,287Nikkei, Nikkan Kogyo, Reuters JP
ChineseZH7,930Sina Finance, EastMoney, 10jqka
SpanishES7,125Expansión, Cinco Días, Bloomberg Línea
EnglishEN6,887CNBC, Yahoo Finance, Fortune, Reuters
GermanDE5,023Börse.de, FAZ, NTV Börse
FrenchFR3,935Boursorama, Tradingsat, BFM Business

Use Cases

  • —News Monitoring — classify sentiment of financial headlines across global markets in real time
  • —Trading Signals — feed sentiment scores into quantitative trading strategies
  • —Portfolio Risk — monitor sentiment shifts across international holdings
  • —Earnings Analysis — analyze tone of corporate press releases and earnings calls
  • —Social Media — track financial discussions on multilingual platforms
  • —Research — cross-language sentiment studies in financial NLP

How It Was Built

  1. 1.Domain Adaptation (TAPT): Masked Language Modeling on 35K+ financial texts across 6 languages — the model learns financial vocabulary and patterns before seeing any labels.
  1. 1.Fine-Tuning: Supervised classification with label smoothing (0.1), cosine LR schedule (2e-5), and Stochastic Weight Averaging of top-3 checkpoints for robust generalization.
ParameterValue
Base modelxlm-roberta-base (278M params)
Learning rate2e-5
SchedulerCosine
Label smoothing0.1
Effective batch size64
PrecisionFP16
Post-processingSWA (top-3 checkpoints)

Dataset

Trained on Kenpache/multilingual-financial-sentiment — ~39K curated financial news samples from 80+ real sources worldwide.

Citation

bibtex
@misc{flame2025,
  title={FLAME: Financial Language Analysis for Multilingual Economics},
  author={Kenpache},
  year={2025},
  url={https://huggingface.co/Kenpache/flame}
}

License

Apache 2.0