brendaogutu marlonbino commited on
Commit
8c87394
·
verified ·
1 Parent(s): eaf10cd

Update model to version 4 (#4)

Browse files

- Update model to version 4 (85a9e9d59203caa3e65336309f161f1c9496ae37)


Co-authored-by: Marlon Amunga <[email protected]>

README.md CHANGED
@@ -1,97 +1,147 @@
1
  ---
2
  datasets:
3
- - ner_distillbert
4
- - openchs/synthetic-helpline-ner-v1
5
  language:
6
  - en
7
- library_name: pytorch
8
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  tags:
10
  - ner
11
- - pytorch
12
  - mlflow
13
- - helpline
14
- task: token-classification
15
- metrics:
16
- - accuracy
17
- base_model:
18
- - distilbert/distilbert-base-uncased
19
  ---
20
 
21
- # ner_distillbert
22
 
23
- ## Model Description
24
 
25
- This is a Named Entity Recognition (NER) model based on DistilBERT, a distilled version of BERT that retains 97% of BERT's performance while being 60% smaller and faster. The model identifies and classifies named entities in text such as persons, organizations, locations, and other predefined categories.
26
 
27
- **Model Details:**
28
- - **Model Name:** ner_distillbert
29
- - **Version:** 1
30
  - **Task:** Ner
31
- - **Framework:** pytorch
32
- - **Language(s):** en
33
  - **License:** apache-2.0
34
 
35
- ## Intended Uses
36
 
37
- This model is designed for ner tasks. Please evaluate on your specific use case before production deployment.
 
 
 
38
 
39
- ## Training Details
 
 
 
40
 
41
- ### Training Data
42
- - **Dataset:** ner_distillbert
43
- - **Dataset Size:** Not specified
44
 
45
- ### Training Configuration
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ## Usage
48
 
49
  ### Installation
50
  ```bash
51
- pip install transformers torch # For transformers models
52
- # OR
53
- pip install -r requirements.txt # For other frameworks
54
  ```
55
 
56
- ### Basic Usage
57
  ```python
58
- # Load and use the model
59
- from inference import Model # See inference.py in the repository
 
 
 
60
 
61
- model = Model(openchs/ner_distillbert_v1)
62
- predictions = model.predict([President Biden met with Chancellor Merkel at the White House to discuss NATO policies.])
63
- print(predictions)
64
  ```
65
 
66
- ## Performance Metrics
67
-
68
- ### Evaluation Results
69
- | Metric | Value |
70
- |--------|-------|
71
- | Epoch | 3.0000 |
72
- | Eval Accuracy | 0.9608 |
73
- | Eval F1 | 0.9433 |
74
- | Eval Loss | 0.1171 |
75
- | Eval Precision | 0.9324 |
76
- | Eval Recall | 0.9608 |
77
- | Eval Runtime | 0.1943 |
78
- | Eval Samples Per Second | 82.3410 |
79
- | Eval Steps Per Second | 10.2930 |
80
 
81
  ## MLflow Tracking
82
 
83
- - **Experiment:** N/A
84
- - **Run ID:** `N/A`
85
- - **Training Date:** N/A
 
 
 
 
 
86
 
87
  ## Citation
88
 
89
  ```bibtex
90
- @misc{ner_distillbert_1,
91
- title={ner_distillbert},
92
- author={BITZ-AI TEAM},
93
  year={2025},
94
  publisher={Hugging Face},
95
- url={https://huggingface.co/marlonbino/ner_distillbert}
96
  }
97
- ```
 
 
 
 
 
 
 
 
1
  ---
2
  datasets:
3
+ - ner_dataset_2.jsonl
 
4
  language:
5
  - en
 
6
  license: apache-2.0
7
+ model-index:
8
+ - name: ner-distilbert-base-cased
9
+ results:
10
+ - dataset:
11
+ name: ner_dataset_2.jsonl
12
+ type: ner_dataset_2.jsonl
13
+ metrics:
14
+ - name: Eval Loss
15
+ type: eval_loss
16
+ value: 0.0216
17
+ - name: Eval Accuracy
18
+ type: eval_accuracy
19
+ value: 0.993
20
+ - name: Eval F1
21
+ type: eval_f1
22
+ value: 0.9929
23
+ - name: Eval Recall
24
+ type: eval_recall
25
+ value: 0.993
26
+ - name: Eval Precision
27
+ type: eval_precision
28
+ value: 0.9933
29
+ task:
30
+ name: Ner
31
+ type: token-classification
32
  tags:
33
  - ner
34
+ - sklearn
35
  - mlflow
36
+ - transformers
37
+ - openchs
 
 
 
 
38
  ---
39
 
40
+ # ner-distilbert-base-cased
41
 
42
+ This model performs ner trained using MLflow and deployed on Hugging Face.
43
 
44
+ ## Model Details
45
 
46
+ - **Model Name:** ner-distilbert-base-cased
47
+ - **Version:** 4
 
48
  - **Task:** Ner
49
+ - **Languages:** en
50
+ - **Framework:** sklearn
51
  - **License:** apache-2.0
52
 
53
+ ## Intended Uses & Limitations
54
 
55
+ ### Intended Uses
56
+ - Ner tasks
57
+ - Research and development
58
+ - Child helpline services support
59
 
60
+ ### Limitations
61
+ - Performance may vary on out-of-distribution data
62
+ - Should be evaluated on your specific use case before production deployment
63
+ - Designed for child helpline contexts, may need adaptation for other domains
64
 
65
+ ## Training Data
 
 
66
 
67
+ - **Dataset:** ner_dataset_2.jsonl
68
+ - **Size:** Not specified
69
+ - **Languages:** en
70
+
71
+ ## Training Configuration
72
+
73
+ | Parameter | Value |
74
+ |-----------|-------|
75
+ | Author | Rogendo |
76
+ | Batch Size | 4 |
77
+ | Epochs | 10 |
78
+ | Lr | 2e-05 |
79
+ | Model Name | distilbert-base-cased |
80
+ | Test Size | 0.1 |
81
+ | Training Date | 2025-10-30T11:58:48.315647 |
82
+ | Weight Decay | 0.01 |
83
+
84
+ ## Performance Metrics
85
+
86
+ ### Evaluation Results
87
+ | Metric | Value |
88
+ |--------|-------|
89
+ | Epoch | 10.0000 |
90
+ | Eval Accuracy | 0.9930 |
91
+ | Eval F1 | 0.9929 |
92
+ | Eval Loss | 0.0216 |
93
+ | Eval Precision | 0.9933 |
94
+ | Eval Recall | 0.9930 |
95
+ | Eval Runtime | 0.1509 |
96
+ | Eval Samples Per Second | 106.0170 |
97
+ | Eval Steps Per Second | 13.2520 |
98
 
99
  ## Usage
100
 
101
  ### Installation
102
  ```bash
103
+ pip install transformers torch
 
 
104
  ```
105
 
106
+ ### Named Entity Recognition Example
107
  ```python
108
+ from transformers import pipeline
109
+
110
+ ner = pipeline("ner", model="openchs/ner_distillbert_v1", aggregation_strategy="simple")
111
+ text = "John Smith works at OpenCHS in Nairobi and can be reached at [email protected]"
112
+ entities = ner(text)
113
 
114
+ for entity in entities:
115
+ print(f"{entity['entity_group']}: {entity['word']} (score: {entity['score']:.2f})")
 
116
  ```
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
  ## MLflow Tracking
120
 
121
+ - **Experiment:** NER_Distilbert/marlon
122
+ - **Run ID:** `10d2648a456a4f6ab74022a9e45c9f40`
123
+ - **Training Date:** 2025-10-30 11:58:48
124
+ - **Tracking URI:** http://192.168.10.6:5000
125
+
126
+ ## Training Metrics Visualization
127
+
128
+ View detailed training metrics and TensorBoard logs in the [Training metrics](https://huggingface.co/openchs/ner_distillbert_v1/tensorboard) tab.
129
 
130
  ## Citation
131
 
132
  ```bibtex
133
+ @misc{ner_distilbert_base_cased,
134
+ title={ner-distilbert-base-cased},
135
+ author={OpenCHS Team},
136
  year={2025},
137
  publisher={Hugging Face},
138
+ url={https://huggingface.co/openchs/ner_distillbert_v1}
139
  }
140
+ ```
141
+
142
+ ## Contact
143
+
144
145
+
146
+ ---
147
+ *Model card auto-generated from MLflow*
config.json CHANGED
@@ -6,31 +6,30 @@
6
  "attention_dropout": 0.1,
7
  "dim": 768,
8
  "dropout": 0.1,
 
9
  "hidden_dim": 3072,
10
  "id2label": {
11
- "0": "LABEL_0",
12
- "1": "LABEL_1",
13
- "2": "LABEL_2",
14
- "3": "LABEL_3",
15
- "4": "LABEL_4",
16
- "5": "LABEL_5",
17
- "6": "LABEL_6",
18
- "7": "LABEL_7",
19
- "8": "LABEL_8",
20
- "9": "LABEL_9"
21
  },
22
  "initializer_range": 0.02,
23
  "label2id": {
24
- "LABEL_0": 0,
25
- "LABEL_1": 1,
26
- "LABEL_2": 2,
27
- "LABEL_3": 3,
28
- "LABEL_4": 4,
29
- "LABEL_5": 5,
30
- "LABEL_6": 6,
31
- "LABEL_7": 7,
32
- "LABEL_8": 8,
33
- "LABEL_9": 9
34
  },
35
  "max_position_embeddings": 512,
36
  "model_type": "distilbert",
@@ -42,7 +41,6 @@
42
  "seq_classif_dropout": 0.2,
43
  "sinusoidal_pos_embds": false,
44
  "tie_weights_": true,
45
- "torch_dtype": "float32",
46
- "transformers_version": "4.53.2",
47
  "vocab_size": 28996
48
  }
 
6
  "attention_dropout": 0.1,
7
  "dim": 768,
8
  "dropout": 0.1,
9
+ "dtype": "float32",
10
  "hidden_dim": 3072,
11
  "id2label": {
12
+ "0": "CALLER",
13
+ "1": "PERPETRATOR",
14
+ "2": "GENDER",
15
+ "3": "VICTIM",
16
+ "4": "AGE",
17
+ "5": "LOCATION",
18
+ "6": "INCIDENT_TYPE",
19
+ "7": "O",
20
+ "8": "COUNSELOR"
 
21
  },
22
  "initializer_range": 0.02,
23
  "label2id": {
24
+ "AGE": 4,
25
+ "CALLER": 0,
26
+ "COUNSELOR": 8,
27
+ "GENDER": 2,
28
+ "INCIDENT_TYPE": 6,
29
+ "LOCATION": 5,
30
+ "O": 7,
31
+ "PERPETRATOR": 1,
32
+ "VICTIM": 3
 
33
  },
34
  "max_position_embeddings": 512,
35
  "model_type": "distilbert",
 
41
  "seq_classif_dropout": 0.2,
42
  "sinusoidal_pos_embds": false,
43
  "tie_weights_": true,
44
+ "transformers_version": "4.56.2",
 
45
  "vocab_size": 28996
46
  }
logs/run_20251030_124314/1761817394.2624462/events.out.tfevents.1761817394.bitz-B760M-DS3H.33391.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a127786ab6f865c09c1a92d3339be0030501ed6414c24279f0d0de50322d787
3
+ size 1263
logs/run_20251030_124314/events.out.tfevents.1761817394.bitz-B760M-DS3H.33391.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b607437e29eae1a9efe5fae22777bee1d9b89b593ef5f96ddc179f31c3ae139
3
+ size 615
metadata.json CHANGED
@@ -1,46 +1,54 @@
1
  {
2
  "mlflow": {
3
  "run_info": {
4
- "run_id": "c46339588b6f41d5b8ecde878813d1f9",
5
- "experiment_id": "35",
6
- "experiment_name": "NER_Distilbert",
7
- "start_time": "2025-09-29 16:23:10",
8
- "end_time": "2025-09-29 16:23:30",
9
  "status": "FINISHED",
10
- "artifact_uri": "/opt/chl_ai/mlflow-shared/artifacts/35/c46339588b6f41d5b8ecde878813d1f9/artifacts"
11
  },
12
  "metrics": {
13
- "eval_loss": 0.11714156717061996,
14
- "eval_accuracy": 0.9608154296875,
15
- "eval_f1": 0.9432683470010941,
16
- "eval_recall": 0.9608154296875,
17
- "eval_precision": 0.9324452434283989,
18
- "eval_runtime": 0.1943,
19
- "eval_samples_per_second": 82.341,
20
- "eval_steps_per_second": 10.293,
21
- "epoch": 3.0
22
  },
23
  "params": {
24
  "model_name": "distilbert-base-cased",
25
- "epochs": "3",
26
  "lr": "2e-05",
27
- "batch_size": "8",
28
  "weight_decay": "0.01",
29
- "test_size": "0.1"
 
 
30
  },
31
  "tags": {
32
  "mlflow.user": "marlon",
33
- "mlflow.source.name": "trainer.py",
34
  "mlflow.source.type": "LOCAL",
35
- "mlflow.source.git.commit": "e03704543c1c918f19e5d1b560a8755096229b82",
36
  "mlflow.runName": "NER_Distilbert"
37
  }
38
  },
39
- "user": {},
 
 
 
 
 
 
40
  "export": {
41
- "method": "unknown",
42
- "timestamp": "2025-10-01T15:55:51.912552",
43
- "version": "1",
44
- "mode": "metrics_only"
45
  }
46
  }
 
1
  {
2
  "mlflow": {
3
  "run_info": {
4
+ "run_id": "10d2648a456a4f6ab74022a9e45c9f40",
5
+ "experiment_id": "118",
6
+ "experiment_name": "NER_Distilbert/marlon",
7
+ "start_time": "2025-10-30 11:58:48",
8
+ "end_time": "2025-10-30 11:59:21",
9
  "status": "FINISHED",
10
+ "artifact_uri": "/opt/chl_ai/mlflow-shared/artifacts/118/10d2648a456a4f6ab74022a9e45c9f40/artifacts"
11
  },
12
  "metrics": {
13
+ "eval_loss": 0.021556653082370758,
14
+ "eval_accuracy": 0.9930419921875,
15
+ "eval_f1": 0.9928845565611383,
16
+ "eval_recall": 0.9930419921875,
17
+ "eval_precision": 0.9933225081085078,
18
+ "eval_runtime": 0.1509,
19
+ "eval_samples_per_second": 106.017,
20
+ "eval_steps_per_second": 13.252,
21
+ "epoch": 10.0
22
  },
23
  "params": {
24
  "model_name": "distilbert-base-cased",
25
+ "epochs": "10",
26
  "lr": "2e-05",
27
+ "batch_size": "4",
28
  "weight_decay": "0.01",
29
+ "test_size": "0.1",
30
+ "training_date": "2025-10-30T11:58:48.315647",
31
+ "author": "Rogendo"
32
  },
33
  "tags": {
34
  "mlflow.user": "marlon",
35
+ "mlflow.source.name": "run_trainer.py",
36
  "mlflow.source.type": "LOCAL",
37
+ "mlflow.source.git.commit": "1d336ef46e41caf713898d4d91d142c43907a543",
38
  "mlflow.runName": "NER_Distilbert"
39
  }
40
  },
41
+ "user": {
42
+ "model_name": "distilbert-base-cased",
43
+ "dataset_name": "ner_dataset_2.jsonl",
44
+ "language": "en",
45
+ "task_type": "ner",
46
+ "framework": "sklearn"
47
+ },
48
  "export": {
49
+ "method": "transformers",
50
+ "timestamp": "2025-10-30T12:43:14.264498",
51
+ "version": "4",
52
+ "mode": "full_update"
53
  }
54
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2d45a23c83fc64bbf0f95dc9b2b1a5a5c37c24a708c11b9ebbba2c63a7ac491b
3
- size 260806744
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:215db0321a1a85118a83e7da4dac593eb20c073d8bc4a71d24a2b31f68ee3e34
3
+ size 260803668
special_tokens_map.json CHANGED
@@ -1,7 +1,37 @@
1
  {
2
- "cls_token": "[CLS]",
3
- "mask_token": "[MASK]",
4
- "pad_token": "[PAD]",
5
- "sep_token": "[SEP]",
6
- "unk_token": "[UNK]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
 
1
  {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
  }
tokenizer_config.json CHANGED
@@ -46,11 +46,18 @@
46
  "do_lower_case": false,
47
  "extra_special_tokens": {},
48
  "mask_token": "[MASK]",
 
49
  "model_max_length": 512,
 
50
  "pad_token": "[PAD]",
 
 
51
  "sep_token": "[SEP]",
 
52
  "strip_accents": null,
53
  "tokenize_chinese_chars": true,
54
  "tokenizer_class": "DistilBertTokenizer",
 
 
55
  "unk_token": "[UNK]"
56
  }
 
46
  "do_lower_case": false,
47
  "extra_special_tokens": {},
48
  "mask_token": "[MASK]",
49
+ "max_length": 512,
50
  "model_max_length": 512,
51
+ "pad_to_multiple_of": null,
52
  "pad_token": "[PAD]",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
  "sep_token": "[SEP]",
56
+ "stride": 0,
57
  "strip_accents": null,
58
  "tokenize_chinese_chars": true,
59
  "tokenizer_class": "DistilBertTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
  "unk_token": "[UNK]"
63
  }