CoolFace
Modelpublic

Aakash1005/sdg-classifier

sourceHugging Facemitupdated 6d agoView on Hugging Face
0likes46downloads
Model Card

sdg-classifier

A 16-class text classifier that assigns a passage to one UN Sustainable Development Goal. Fine-tuned from distilbert-base-uncased on the OSDG Community Dataset.

Built primarily as an investigation into the benchmark itself. Read the limitations section before using the per-class scores to compare against other models — one class in this dataset is separable by writing style rather than topic, which inflates aggregate metrics.

Intended use

  • First-pass SDG tagging of policy text, dataset descriptions, and report excerpts, for human review
  • A reproducible baseline for OSDG-CD experiments

Out of scope

  • Any use where the output is acted on without review
  • SDG 17 (Partnerships), which is absent from the training data
  • Detecting that a text is not SDG-related — there is no negative class, so the model will assign a goal to any input, including unrelated text
  • Short inputs. Training excerpts average ~100 words; performance on titles or single phrases is untested

Results

Test set: 8,605 held-out examples. Training set filtered to agreement ≥ 0.5.

ConfigurationAccuracyMacro F1
3 epochs0.7930.762
6 epochs (this model)0.7990.772

Per-class (6 epochs):

ClassPrecisionRecallF1Support
SDG 1 — No Poverty0.7290.6190.670494
SDG 2 — Zero Hunger0.7770.8000.789506
SDG 3 — Good Health0.9040.8610.882526
SDG 4 — Quality Education0.8870.8290.857736
SDG 5 — Gender Equality0.8140.8480.831875
SDG 6 — Clean Water0.7640.8070.785549
SDG 7 — Affordable Energy0.7850.8380.810610
SDG 8 — Decent Work0.3990.5320.456284
SDG 9 — Industry & Infrastructure0.7820.7530.767543
SDG 10 — Reduced Inequalities0.6130.6480.630457
SDG 11 — Sustainable Cities0.7430.7930.767497
SDG 12 — Responsible Consumption0.7550.6870.719233
SDG 13 — Climate Action0.7790.7260.751452
SDG 14 — Life Below Water0.8710.7920.830231
SDG 15 — Life on Land0.8510.7940.822554
SDG 16 — Peace & Justice0.9840.9850.9841058

Limitations

SDG 16's score is partly an artefact. At 0.984 F1 it is far above every other class, on arguably the framework's most abstract goal. A TF-IDF + logistic regression model trained on only the first eight words of each excerpt reaches 0.739 F1 on SDG 16 against a macro average of 0.327 — eight words carry no topical content, so the class is identifiable from stylistic register alone. Sampled SDG 16 excerpts are overwhelmingly academic law and political-science abstracts ("This article provides a theoretically informed analysis…"). The signal is distributed through the text, not confined to the opening: removing the lead sentence cost SDG 16 only 0.016 F1 while costing other classes 0.05–0.10.

SDG 16 is 12.3% of the test set, so this inflates the aggregate numbers above. Per-class scores on this benchmark are not comparable across goals.

SDG 8 is unreliable. Precision 0.399 — when this model predicts SDG 8, it is wrong roughly 6 times in 10. SDG 1, 8, and 10 form a confusion cluster (1→10 at 0.16, 8→10 at 0.12, 10→8 at 0.11) reflecting genuine conceptual overlap between poverty, decent work, and inequality. Treat SDG 8 predictions as low confidence.

Single-label on a multi-label problem. Real passages often address several goals at once. This model returns one.

No confidence intervals. Single seed, single run.

Training

Base modeldistilbert-base-uncased
Datasetalbertmartinez/OSDG, config 2024-04-01
Filteragreement ≥ 0.5
Splits30,978 train / 3,442 val / 8,605 test
Max length256 tokens
Epochs6
Batch size32
Learning rate3e-5, 10% warmup
Hardware1 Kaggle session, T4
Model selectionbest val macro-F1

Usage

python
from transformers import pipeline

clf = pipeline("text-classification", model="USERNAME/sdg-classifier")
clf("Rural households gained access to piped drinking water and sanitation.")
# [{'label': 'SDG 6', 'score': 0.59}]

Citation

Dataset: OSDG, UNDP IICPSD SDG AI Lab, & PPMI. OSDG Community Dataset (OSDG-CD). Zenodo. https://doi.org/10.5281/zenodo.5550238 (CC BY 4.0)