Views
No views yet
| Model | F1 Score | Accuracy | Loss |
|---|---|---|---|
| CBSI-bert-base-uncased | 0.88 | 0.88 | 0.49 |
| CBSI-bert-large-uncased | 0.92 | 0.92 | 0.45 |
| CBSI-ModernBERT-base | 0.93 | 0.93 | 0.40 |
| CBSI-ModernBERT-large | 0.91 | 0.91 | 0.53 |
| CBSI-CentralBank-BERT | 0.92 | 0.92 | 0.36 |
1import pandas as pd
2from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
3
4# Load model and tokenizer
5model_name = "brjoey/CBSI-ModernBERT-base"
6classifier = pipeline(
7 "text-classification",
8 model=model_name,
9 tokenizer=model_name
10)
11
12# Define label mapping
13cbsi_label_map = {
14 0: "neutral",
15 1: "dovish",
16 2: "hawkish"
17}
18
19# Example texts
20texts = [
21 "The Governing Council decided to lower interest rates.",
22 "The central bank will maintain its current policy stance."
23]
24df = pd.DataFrame({"text": texts})
25
26# Run classification
27predictions = classifier(df["text"].tolist())
28
29# Store the results
30df["label"], df["score"] = zip(*[
31 (cbsi_label_map[int(pred["label"].split("_")[-1])], pred["score"])
32 for pred in predictions
33])
34
35print("\n === Results ===\n")
36print(df[["text", "label", "score"]])