Text Classification
Transformers
ONNX
Safetensors
Transformers.js
English
bert
finance
central-bank
monetary-policy
ghana
text-embeddings-inference
Instructions to use Kobichris/cb-policy-tone with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kobichris/cb-policy-tone with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Kobichris/cb-policy-tone")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Kobichris/cb-policy-tone") model = AutoModelForSequenceClassification.from_pretrained("Kobichris/cb-policy-tone", device_map="auto") - Transformers.js
How to use Kobichris/cb-policy-tone with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'Kobichris/cb-policy-tone'); - Notebooks
- Google Colab
- Kaggle
cb-policy-tone (v0)
Classifies a sentence from a Bank of Ghana Monetary Policy Committee statement as hawkish, neutral or dovish. Part of the project github.com/Mbibachris/cb-policy-tone, with a demo at huggingface.co/spaces/Kobichris/policy-tone.
Training
- Base model:
ProsusAI/finbert, fine-tuned for 3 classes (dovish, neutral, hawkish). - Data: sentences from Bank of Ghana MPC statements, 2003-2026, split by date (train up to 2018, validation 2019-2021, test 2022-2026). Sentences announcing the rate decision are excluded.
- Labels: weak labels from a rule-based lexicon written by the author from a published codebook. The model therefore learns to imitate the rules.
- Class-weighted cross-entropy; 4 epochs; max length 128.
Results so far
- Agreement with the rule labels (macro-F1): 0.74 on validation, 0.78 on the 2022-2026 test years. This is agreement with the rules, not accuracy.
- Accuracy against hand-labelled sentences: pending (a blind 400-sentence gold set is being labelled).
- Statement-level tone is associated with the next policy-rate decision in-sample, but does not improve out-of-sample forecasts beyond past decisions and inflation.
Limitations
- Trained on one central bank's English statements; other banks or genres are untested.
- Inherits the lexicon's blind spots, e.g. rising inflation reads as hawkish even when inflation is low.
- Research prototype; not financial advice.
Use
from transformers import pipeline
clf = pipeline("text-classification", model="Kobichris/cb-policy-tone", top_k=None)
clf("Inflation pressures have intensified and risks are tilted to the upside.")
In the browser (transformers.js): pipeline("text-classification", "Kobichris/cb-policy-tone", { dtype: "fp16" })
uses onnx/model_fp16.onnx (16-bit, about 220 MB). 8-bit versions were tested and rejected:
they gave the same label as the full model on only about 84% of 500 test sentences.
Author: Christopher Mbiba.
- Downloads last month
- 11
Model tree for Kobichris/cb-policy-tone
Base model
ProsusAI/finbert