Built for
SupplyGuard AI —
a production-grade supply chain risk intelligence platform.
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="arunabhachanda/supplychain-finbert",
6 return_all_scores=True,
7)
8
9result = classifier("Ceasefire in the region reopens key supply corridors")
10# → [{'label': 'negative', 'score': 0.04},
11# {'label': 'neutral', 'score': 0.11},
12# {'label': 'positive', 'score': 0.85}]
13
14# Polarity score used by SupplyGuard AI:
15polarity = result[2]['score'] - result[0]['score'] # P(positive) - P(negative)
16# → float in [-1.0, +1.0] used as region_news_sentiment feature
ProsusAI/finbert (pre-trained on financial news corpus)
├── BERT Embeddings [FROZEN] ← vocabulary + positional encoding
├── Transformer Layer 0–9 [FROZEN] ← general language + financial knowledge
├── Transformer Layer 10–11 [TRAINABLE] ← adapted to supply-chain language
├── Pooler [TRAINABLE] ← [CLS] token representation
└── Classifier Head (768→3) [TRAINABLE] ← new head for 3-class sentiment
Arunabha Kumar Chanda — M.Sc. Business Intelligence & Data Science, ISM Munich
GitHub:
arunabhachanda