How bilalezafar/centralbank-bert works
Purpose and Execution Model
This is a notebook-driven NLP research pipeline for analyzing CBDC discourse in central-bank text. There is no application service or package entry point; notebooks are the executable entry points for model training, inference, evaluation, and publication-result generation.
1. Domain Encoder Foundation
Domain adaptation starts with masked-language-model training over BIS speeches, producing the CentralBank-BERT encoder used by downstream tasks.
• 1-Central Bank BERT (MLM)/CentralBank-BERT.ipynb
The resulting encoder is externally published on Hugging Face as bilalezafar/CentralBank-BERT; training data and model artifacts are not represented as a reusable local code module.
2. CBDC Detection Gate
The binary CBDC-vs-non-CBDC classifier is the gating stage for broad corpora: text extraction and keyword-assisted data preparation feed fine-tuning, then accepted CBDC material can receive finer labels.
• 2-CBDC-BERT/CBDC speeches data extraction for BERT.ipynb
• 2-CBDC-BERT/CBDC-BERT model training and evaluation.ipynb
• 2-CBDC-BERT/bert_training_data.csv
cbdc_keywords.csv is a material extraction boundary. The trained classifier is served externally as bilalezafar/CBDC-BERT.
3. Independent CBDC Attribute Classifiers
Four separately trained sentence-level classifiers consume CBDC text and predict complementary dimensions. Each notebook owns preprocessing, tokenization, fine-tuning, and evaluation, backed by its labeled CSV.
• Stance—Pro, Wait-and-See, Anti: 3-CBDC-Stance/cbdc-stance.ipynb, 3-CBDC-Stance/stance_sentences.csv
• Sentiment—Positive, Neutral, Negative: 4-CBDC-Sentiment/cbdc-sentiment.ipynb, 4-CBDC-Sentiment/cbdc_sentiment_training.csv
• Type—Retail, Wholesale, General: 5-CBDC-Type/cbdc-type.ipynb, 5-CBDC-Type/cbdc_type_training.csv
• Discourse—Feature, Process, Risk-Benefit: 6-CBDC-Discourse/cbdc-discourse.ipynb, 6-CBDC-Discourse/cbdc_classification_training.csv
These models are released separately through Hugging Face, rather than versioned as local weights.
4. Central-Bank NER Extension
NER is a parallel task built on the domain-adapted encoder, intended to identify entities in central-banking discourse rather than enrich the CBDC classifier output directly.
• 7-CentralBank-NER/CentralBank-NER.ipynb
• 7-CentralBank-NER/Access link to BIS Speeches NER dataset.docx
Its dataset is externally accessed, making dataset availability a reproducibility boundary.
5. Integrated Corpus Inference
The primary end-to-end analysis entry point reads a finalized CBDC corpus, invokes the classifier suite, and writes row-level predictions.
• 8-CBDC-Analysis and Results/CBDC Analysis and Resutls.ipynb
• 8-CBDC-Analysis and Results/cbdc-dataset-final.csv
• 8-CBDC-Analysis and Results/cbdc-dataset-predictions.csv
Control flow is corpus input → CBDC gate/attribute predictions → merged prediction dataset → aggregate analysis. The prediction CSV is the central handoff between ML inference and research reporting.
6. Results, Robustness, and Benchmarking
Post-inference outputs are materialized as CSV tables for label distributions, time series, crosstabs, confidence review, and exemplars.
• 8-CBDC-Analysis and Results/prediction_results/
• 8-CBDC-Analysis and Results/descriptive_results/
• 8-CBDC-Analysis and Results/compare_out/Comparision - Robustness.ipynb
A matched encoder benchmark compares BERT-base-uncased against CentralBank-BERT across the CBDC tasks:
• 8-CBDC-Analysis and Results/CBDC classifiers benchmark with BERT-base.ipynb
Runtime and External Dependencies
The runtime is Python/Jupyter with transformer-based BERT fine-tuning and inference. Hugging Face is the key external model distribution service. BIS speeches underpin encoder training and NER data access; the repository retains local labeled datasets and generated analytical outputs, but not a deployable API, orchestration system, or centralized pipeline library.
Main entry points: CBDC Analysis and Resutls.ipynb CBDC analysis · cbdc-dataset-predictions.csv Prediction dataset · CBDC-BERT model training and evaluation.ipynb CBDC-BERT training · CentralBank-BERT.ipynb CentralBank-BERT MLM
Components 18
Domain Foundation
- BIS speeches · Source corpus for domain adaptation and NER data access.
- CentralBank-BERT MLM · Adapts BERT with masked-language modeling.
1-Central Bank BERT (MLM)/CentralBank-BERT.ipynb - CentralBank-BERT · Shared domain-adapted Hugging Face encoder.
- CentralBank-NER · Parallel central-banking entity-recognition task.
7-CentralBank-NER/CentralBank-NER.ipynb
CBDC Classifier Training
- CBDC speech extraction
2-CBDC-BERT/CBDC speeches data extraction for BERT.ipynb - CBDC gate labels
2-CBDC-BERT/bert_training_data.csv - CBDC-BERT training · Fine-tunes and evaluates the CBDC detection gate.
2-CBDC-BERT/CBDC-BERT model training and evaluation.ipynb - CBDC-BERT · External CBDC versus non-CBDC gate model.
- Stance classifier · Predicts Pro, Wait-and-See, or Anti.
3-CBDC-Stance/cbdc-stance.ipynb - Sentiment classifier · Predicts Positive, Neutral, or Negative.
4-CBDC-Sentiment/cbdc-sentiment.ipynb - Type classifier · Predicts Retail, Wholesale, or General.
5-CBDC-Type/cbdc-type.ipynb - Discourse classifier · Predicts Feature, Process, or Risk-Benefit.
6-CBDC-Discourse/cbdc-discourse.ipynb
Corpus Inference
- Final CBDC corpus
8-CBDC-Analysis and Results/cbdc-dataset-final.csv - CBDC analysis · Runs the classifier suite and aggregates predictions.
8-CBDC-Analysis and Results/CBDC Analysis and Resutls.ipynb - Prediction dataset · Central handoff from inference to reporting.
8-CBDC-Analysis and Results/cbdc-dataset-predictions.csv
Results and Validation
- Research result tables · Distributions, time series, crosstabs, confidence review, and exemplars.
- Robustness comparison
8-CBDC-Analysis and Results/compare_out/Comparision - Robustness.ipynb - Encoder benchmark · Compares BERT-base-uncased with CentralBank-BERT across CBDC tasks.
8-CBDC-Analysis and Results/CBDC classifiers benchmark with BERT-base.ipynb
Connections 22
- BIS speeches → CentralBank-BERT MLM: MLM corpus
- CentralBank-BERT MLM → CentralBank-BERT: publishes
- CentralBank-BERT → CBDC-BERT training: initializes
- CBDC speech extraction → CBDC gate labels: prepares
- CBDC gate labels → CBDC-BERT training: fine-tuning labels
- CBDC-BERT training → CBDC-BERT: publishes
- CentralBank-BERT → Stance classifier: initializes
- CentralBank-BERT → Sentiment classifier: initializes
- CentralBank-BERT → Type classifier: initializes
- CentralBank-BERT → Discourse classifier: initializes
- BIS speeches → CentralBank-NER: external NER data
- CentralBank-BERT → CentralBank-NER: encoder base
- Final CBDC corpus → CBDC analysis: corpus input
- CBDC-BERT → CBDC analysis: CBDC gate
- Stance classifier → CBDC analysis: stance predictions
- Sentiment classifier → CBDC analysis: sentiment predictions
- Type classifier → CBDC analysis: type predictions
- Discourse classifier → CBDC analysis: discourse predictions
- CBDC analysis → Prediction dataset: writes merged rows
- Prediction dataset → Research result tables: aggregates
- Prediction dataset → Robustness comparison: evaluates
- CentralBank-BERT → Encoder benchmark: compares