Instructions to use Jayi2424/mhdc-bert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jayi2424/mhdc-bert-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Jayi2424/mhdc-bert-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Jayi2424/mhdc-bert-base") model = AutoModelForSequenceClassification.from_pretrained("Jayi2424/mhdc-bert-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Replace the converted checkpoint with the retrained model.
Browse files- README.md +6 -4
- classification_report.txt +16 -0
- config.json +1 -0
- metrics.json +109 -0
- model.safetensors +1 -1
- tokenizer.json +16 -2
README.md
CHANGED
|
@@ -11,13 +11,15 @@ pipeline_tag: text-classification
|
|
| 11 |
|
| 12 |
# MHDC BERT-base
|
| 13 |
|
| 14 |
-
Fine-tuned bert-base-uncased
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
## Labels
|
| 23 |
|
|
|
|
| 11 |
|
| 12 |
# MHDC BERT-base
|
| 13 |
|
| 14 |
+
Fine-tuned from [bert-base-uncased](https://huggingface.co/bert-base-uncased) for 10-way classification of mental-health conditions and cyberbullying in social-media posts.
|
| 15 |
|
| 16 |
+
This repository is the retrained model: config, tokenizer, and weights from one fine-tuning run. It replaces an earlier upload that was only a converted checkpoint.
|
| 17 |
|
| 18 |
+
Held-out test set, 6,000 imbalanced posts: accuracy 0.876, macro F1 0.700.
|
| 19 |
+
|
| 20 |
+
Ajayi, Kachweka, Deku, and Aiken, PMLR 317:15-26, 2026. Best Paper, AAAI-26 AIMedHealth Bridge. https://proceedings.mlr.press/v317/ajayi26a.html
|
| 21 |
|
| 22 |
+
A screening aid with a person in the loop, not a diagnostic tool.
|
| 23 |
|
| 24 |
## Labels
|
| 25 |
|
classification_report.txt
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
precision recall f1-score support
|
| 2 |
+
|
| 3 |
+
age_cb 0.9290 0.9714 0.9497 175
|
| 4 |
+
anxiety 0.4899 0.9125 0.6376 80
|
| 5 |
+
bipolar 0.3214 0.8182 0.4615 55
|
| 6 |
+
ethnicity_cb 0.8291 0.9593 0.8895 172
|
| 7 |
+
gender_cb 0.4807 0.9701 0.6429 167
|
| 8 |
+
non_suicide 0.9780 0.7850 0.8709 2549
|
| 9 |
+
personality_disorder 0.2321 0.6500 0.3421 20
|
| 10 |
+
religion_cb 0.9202 0.9886 0.9532 175
|
| 11 |
+
stress 0.1803 0.8400 0.2968 50
|
| 12 |
+
suicide 0.9765 0.9429 0.9594 2557
|
| 13 |
+
|
| 14 |
+
accuracy 0.8758 6000
|
| 15 |
+
macro avg 0.6337 0.8838 0.7004 6000
|
| 16 |
+
weighted avg 0.9345 0.8758 0.8941 6000
|
config.json
CHANGED
|
@@ -42,6 +42,7 @@
|
|
| 42 |
"num_hidden_layers": 12,
|
| 43 |
"pad_token_id": 0,
|
| 44 |
"position_embedding_type": "absolute",
|
|
|
|
| 45 |
"transformers_version": "4.57.0",
|
| 46 |
"type_vocab_size": 2,
|
| 47 |
"use_cache": true,
|
|
|
|
| 42 |
"num_hidden_layers": 12,
|
| 43 |
"pad_token_id": 0,
|
| 44 |
"position_embedding_type": "absolute",
|
| 45 |
+
"problem_type": "single_label_classification",
|
| 46 |
"transformers_version": "4.57.0",
|
| 47 |
"type_vocab_size": 2,
|
| 48 |
"use_cache": true,
|
metrics.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "bert",
|
| 3 |
+
"base": "bert-base-uncased",
|
| 4 |
+
"max_length": 128,
|
| 5 |
+
"batch_size": 16,
|
| 6 |
+
"learning_rate": 2e-05,
|
| 7 |
+
"history": [
|
| 8 |
+
{
|
| 9 |
+
"epoch": 1,
|
| 10 |
+
"train_loss": 0.635437068608072,
|
| 11 |
+
"val_loss": 0.3612299501895905
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"epoch": 2,
|
| 15 |
+
"train_loss": 0.2068724955563192,
|
| 16 |
+
"val_loss": 0.3055341985573371
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"epoch": 3,
|
| 20 |
+
"train_loss": 0.09837905935287751,
|
| 21 |
+
"val_loss": 0.29517640147979063
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"epoch": 4,
|
| 25 |
+
"train_loss": 0.047046463677435424,
|
| 26 |
+
"val_loss": 0.35499928873187553
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"epoch": 5,
|
| 30 |
+
"train_loss": 0.0375277167787189,
|
| 31 |
+
"val_loss": 0.3443247995137547
|
| 32 |
+
}
|
| 33 |
+
],
|
| 34 |
+
"test_report": {
|
| 35 |
+
"age_cb": {
|
| 36 |
+
"precision": 0.9289617486338798,
|
| 37 |
+
"recall": 0.9714285714285714,
|
| 38 |
+
"f1-score": 0.9497206703910615,
|
| 39 |
+
"support": 175.0
|
| 40 |
+
},
|
| 41 |
+
"anxiety": {
|
| 42 |
+
"precision": 0.4899328859060403,
|
| 43 |
+
"recall": 0.9125,
|
| 44 |
+
"f1-score": 0.6375545851528385,
|
| 45 |
+
"support": 80.0
|
| 46 |
+
},
|
| 47 |
+
"bipolar": {
|
| 48 |
+
"precision": 0.32142857142857145,
|
| 49 |
+
"recall": 0.8181818181818182,
|
| 50 |
+
"f1-score": 0.46153846153846156,
|
| 51 |
+
"support": 55.0
|
| 52 |
+
},
|
| 53 |
+
"ethnicity_cb": {
|
| 54 |
+
"precision": 0.8291457286432161,
|
| 55 |
+
"recall": 0.9593023255813954,
|
| 56 |
+
"f1-score": 0.889487870619946,
|
| 57 |
+
"support": 172.0
|
| 58 |
+
},
|
| 59 |
+
"gender_cb": {
|
| 60 |
+
"precision": 0.4807121661721068,
|
| 61 |
+
"recall": 0.9700598802395209,
|
| 62 |
+
"f1-score": 0.6428571428571429,
|
| 63 |
+
"support": 167.0
|
| 64 |
+
},
|
| 65 |
+
"non_suicide": {
|
| 66 |
+
"precision": 0.9780058651026393,
|
| 67 |
+
"recall": 0.7850137308748529,
|
| 68 |
+
"f1-score": 0.8709466811751905,
|
| 69 |
+
"support": 2549.0
|
| 70 |
+
},
|
| 71 |
+
"personality_disorder": {
|
| 72 |
+
"precision": 0.23214285714285715,
|
| 73 |
+
"recall": 0.65,
|
| 74 |
+
"f1-score": 0.34210526315789475,
|
| 75 |
+
"support": 20.0
|
| 76 |
+
},
|
| 77 |
+
"religion_cb": {
|
| 78 |
+
"precision": 0.9202127659574468,
|
| 79 |
+
"recall": 0.9885714285714285,
|
| 80 |
+
"f1-score": 0.953168044077135,
|
| 81 |
+
"support": 175.0
|
| 82 |
+
},
|
| 83 |
+
"stress": {
|
| 84 |
+
"precision": 0.18025751072961374,
|
| 85 |
+
"recall": 0.84,
|
| 86 |
+
"f1-score": 0.2968197879858657,
|
| 87 |
+
"support": 50.0
|
| 88 |
+
},
|
| 89 |
+
"suicide": {
|
| 90 |
+
"precision": 0.9765087079789389,
|
| 91 |
+
"recall": 0.9429018380915135,
|
| 92 |
+
"f1-score": 0.9594110624751293,
|
| 93 |
+
"support": 2557.0
|
| 94 |
+
},
|
| 95 |
+
"accuracy": 0.8758333333333334,
|
| 96 |
+
"macro avg": {
|
| 97 |
+
"precision": 0.633730880769531,
|
| 98 |
+
"recall": 0.8837959592969101,
|
| 99 |
+
"f1-score": 0.7003609569430667,
|
| 100 |
+
"support": 6000.0
|
| 101 |
+
},
|
| 102 |
+
"weighted avg": {
|
| 103 |
+
"precision": 0.9344826980933373,
|
| 104 |
+
"recall": 0.8758333333333334,
|
| 105 |
+
"f1-score": 0.8941139725932447,
|
| 106 |
+
"support": 6000.0
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 437983256
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e2b4bf6afb717b1d31dff3ce73b03c90ed3d7ada65c276d6091d17cf55e6626
|
| 3 |
size 437983256
|
tokenizer.json
CHANGED
|
@@ -1,7 +1,21 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
| 7 |
"id": 0,
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": {
|
| 4 |
+
"direction": "Right",
|
| 5 |
+
"max_length": 128,
|
| 6 |
+
"strategy": "LongestFirst",
|
| 7 |
+
"stride": 0
|
| 8 |
+
},
|
| 9 |
+
"padding": {
|
| 10 |
+
"strategy": {
|
| 11 |
+
"Fixed": 128
|
| 12 |
+
},
|
| 13 |
+
"direction": "Right",
|
| 14 |
+
"pad_to_multiple_of": null,
|
| 15 |
+
"pad_id": 0,
|
| 16 |
+
"pad_type_id": 0,
|
| 17 |
+
"pad_token": "[PAD]"
|
| 18 |
+
},
|
| 19 |
"added_tokens": [
|
| 20 |
{
|
| 21 |
"id": 0,
|