Upload ESG Topic Classifier (Macro-F1: 0.7070)
Browse files
README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: ['vi']
|
| 3 |
+
license: mit
|
| 4 |
+
tags: ['text-classification', 'phobert', 'vietnamese', 'esg', 'sustainability']
|
| 5 |
+
metrics:
|
| 6 |
+
- macro-f1
|
| 7 |
+
- accuracy
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# PhoBERT ESG Topic Classifier (Vietnamese Banking Reports)
|
| 11 |
+
|
| 12 |
+
A fine-tuned [vinai/phobert-base-v2](https://huggingface.co/vinai/phobert-base-v2) model for **sentence-level ESG topic classification** in Vietnamese banking reports.
|
| 13 |
+
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
## Model Description
|
| 17 |
+
|
| 18 |
+
This model classifies Vietnamese sentences extracted from **banking annual and sustainability reports** into **6 ESG-related topic categories**:
|
| 19 |
+
|
| 20 |
+
- **Non-ESG**: General business, financial, or operational content not related to ESG
|
| 21 |
+
- **E (Environmental)**: Environmental topics such as emissions, energy, climate, waste, and resource usage
|
| 22 |
+
- **S (Social)**: Social topics including employees, community, customer protection, health & safety
|
| 23 |
+
- **G (Governance)**: Corporate governance topics such as board structure, compliance, risk management
|
| 24 |
+
- **Policy**: ESG-related strategies, policies, commitments, and frameworks
|
| 25 |
+
- **Financing**: Green or sustainable finance activities (green bonds, sustainable credit, ESG-linked finance)
|
| 26 |
+
|
| 27 |
+
The model is designed as **Stage B (Topic Classification)** in a larger ESG-washing analysis pipeline.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## Training Data
|
| 32 |
+
|
| 33 |
+
- **Source**: Vietnamese banking annual and sustainability reports
|
| 34 |
+
- **Time span**: 2015–2024
|
| 35 |
+
- **Sentence-level corpus** after OCR cleaning and quality filtering
|
| 36 |
+
|
| 37 |
+
Dataset splits:
|
| 38 |
+
- **Train**: 926 sentences
|
| 39 |
+
- **Dev**: 127 sentences
|
| 40 |
+
- **Test**: 272 sentences
|
| 41 |
+
|
| 42 |
+
All splits are constructed with **bank-year group isolation** to prevent information leakage.
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## Training Procedure
|
| 47 |
+
|
| 48 |
+
- **Base model**: `vinai/phobert-base-v2`
|
| 49 |
+
- **Fine-tuning strategy**: Full fine-tuning
|
| 50 |
+
- **Loss**: Class-weighted CrossEntropyLoss (to address class imbalance)
|
| 51 |
+
- **Optimizer**: AdamW
|
| 52 |
+
- Learning rate: 2e-05
|
| 53 |
+
- Weight decay: 0.01
|
| 54 |
+
- **Batch size**: 16
|
| 55 |
+
- **Max sequence length**: 256 tokens
|
| 56 |
+
- **Epochs trained**: 8
|
| 57 |
+
- **Best checkpoint**: Epoch 4 (selected by DEV Macro-F1)
|
| 58 |
+
- **Random seed**: 42
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## Evaluation Results
|
| 63 |
+
|
| 64 |
+
**Primary metric:** Macro-F1 (robust to class imbalance)
|
| 65 |
+
|
| 66 |
+
| Metric | DEV | TEST |
|
| 67 |
+
|------------|---------|---------|
|
| 68 |
+
| Macro-F1 | 0.7214 | 0.7070 |
|
| 69 |
+
| Accuracy | 0.7874 | 0.7537 |
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
### Per-class Performance (TEST)
|
| 74 |
+
|
| 75 |
+
| Label | Precision | Recall | F1 | Support |
|
| 76 |
+
|------|-----------|--------|----|---------|
|
| 77 |
+
| E | 0.789 | 0.857 | 0.822 | 35 |
|
| 78 |
+
| Financing | 0.647 | 0.458 | 0.537 | 24 |
|
| 79 |
+
| G | 0.769 | 0.741 | 0.755 | 54 |
|
| 80 |
+
| Non-ESG | 0.748 | 0.873 | 0.805 | 102 |
|
| 81 |
+
| Policy | 0.692 | 0.562 | 0.621 | 16 |
|
| 82 |
+
| S | 0.788 | 0.634 | 0.703 | 41 |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Intended Use
|
| 87 |
+
|
| 88 |
+
- ESG topic analysis for Vietnamese banking reports
|
| 89 |
+
- Preprocessing step for **ESG-washing detection**
|
| 90 |
+
- Academic research (thesis / paper-level experiments)
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## Usage
|
| 95 |
+
|
| 96 |
+
```python
|
| 97 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 98 |
+
import torch
|
| 99 |
+
|
| 100 |
+
model_name = "huypham71/esg-topic-classifier"
|
| 101 |
+
|
| 102 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
| 103 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 104 |
+
|
| 105 |
+
text = "Ngân hàng cam kết giảm 20% lượng khí thải carbon vào năm 2025."
|
| 106 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
|
| 107 |
+
|
| 108 |
+
with torch.no_grad():
|
| 109 |
+
outputs = model(**inputs)
|
| 110 |
+
probs = torch.softmax(outputs.logits, dim=-1)
|
| 111 |
+
pred_id = torch.argmax(probs).item()
|
| 112 |
+
|
| 113 |
+
print("Prediction:", model.config.id2label[pred_id])
|
| 114 |
+
print("Confidence:", float(probs[0, pred_id]))
|
| 115 |
+
|
| 116 |
+
## Limitations
|
| 117 |
+
|
| 118 |
+
Trained specifically on Vietnamese banking reports
|
| 119 |
+
|
| 120 |
+
Not intended for other industries or languages
|
| 121 |
+
|
| 122 |
+
Some ambiguity exists between Policy, Environmental, and Financing categories due to overlapping ESG discourse
|
| 123 |
+
|
| 124 |
+
Minority classes (E, Policy) have fewer samples than Non-ESG and Governance
|
| 125 |
+
|
| 126 |
+
## Citation
|
| 127 |
+
|
| 128 |
+
If you use this model, please cite:
|
| 129 |
+
|
| 130 |
+
```bibtex
|
| 131 |
+
@misc{esg-topic-classifier,
|
| 132 |
+
author = {huypham71},
|
| 133 |
+
title = {ESG Topic Classifier for Vietnamese Banking Reports},
|
| 134 |
+
year = {2026},
|
| 135 |
+
publisher = {Hugging Face},
|
| 136 |
+
url = {https://huggingface.co/huypham71/esg-topic-classifier}
|
| 137 |
+
}
|
| 138 |
+
```
|
| 139 |
+
|