1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="Kenpache/perspective-aware-financial-sentiment"
6)
7
8# IMPORTANT: Always prefix with [LANG] for correct perspective
9classifier("[EN] Federal Reserve cuts interest rates by 25 basis points")
10# → {'label': 'positive', 'score': 0.94}
11
12classifier("[AR] Oil prices fall sharply to $60 per barrel")
13# → {'label': 'negative', 'score': 0.89} (Arab: oil exporter → bad)
14
15classifier("[HI] Oil prices fall sharply to $60 per barrel")
16# → {'label': 'positive', 'score': 0.87} (India: oil importer → good)
1from transformers import pipeline
2classifier = pipeline("text-classification",
3 model="Kenpache/perspective-aware-financial-sentiment")
4
5oil_drop = "Oil prices fall to $60 per barrel"
6
7results = {}
8for lang in ["AR", "HI", "EN", "DE", "JA", "KO"]:
9 r = classifier(f"[{lang}] {oil_drop}")[0]
10 results[lang] = f"{r['label']} ({r['score']:.2f})"
11
12# AR → negative (Gulf exporter: lost revenue)
13# HI → positive (India importer: lower costs)
14# EN → positive (US: lower inflation)
15# DE → positive (Germany: lower energy costs)
16# JA → positive (Japan: lower import costs)
17# KO → positive (Korea: lower import costs)
1headlines = [
2 "[EN] Amazon reports record quarterly revenue of $187 billion",
3 "[AR] OPEC+ agrees to increase oil output by 400,000 bpd",
4 "[HI] OPEC+ agrees to increase oil output by 400,000 bpd",
5 "[JA] Bank of Japan raises interest rates to 0.5%",
6 "[DE] ECB cuts rates by 25 basis points amid slowdown",
7 "[ZH] CSI 300 index rises 2.3% on stimulus optimism",
8]
9
10results = classifier(headlines)
11for h, r in zip(headlines, results):
12 print(f"{h[:50]:<50} → {r['label']} ({r['score']:.2f})")
Trained on
FLAME Perspective-Aware Financial Sentiment Dataset — 145,637 headlines across 10 languages with local investor perspective labeling.
1@model{perspective_aware_financial_sentiment_2026,
2 title = {FLAME2: Multilingual Perspective-Aware Financial Sentiment Model},
3 author = {Zaraki},
4 year = {2026},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/Kenpache/perspective-aware-financial-sentiment}
7}