Run this model with HF Jobs

Run rIsHu009/bert-conll2003-ner on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/rIsHu009/bert-conll2003-ner. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/rIsHu009/bert-conll2003-ner on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
File size: 7,439 Bytes
6c9e58b
 
 
b62cbfa
 
6c9e58b
b62cbfa
 
 
 
 
 
 
 
6c9e58b
b62cbfa
 
 
6c9e58b
 
 
 
 
 
b62cbfa
6c9e58b
 
 
 
 
b62cbfa
6c9e58b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b62cbfa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c9e58b
b62cbfa
6c9e58b
b62cbfa
 
 
 
6c9e58b
b62cbfa
6c9e58b
b62cbfa
6c9e58b
b62cbfa
 
 
 
 
 
 
 
 
6c9e58b
 
 
b62cbfa
6c9e58b
b62cbfa
6c9e58b
b62cbfa
 
 
 
 
6c9e58b
b62cbfa
6c9e58b
b62cbfa
6c9e58b
b62cbfa
 
 
 
6c9e58b
 
 
b62cbfa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
---
library_name: transformers
license: apache-2.0
pipeline_tag: token-classification
base_model: google-bert/bert-base-cased
datasets:
- eriktks/conll2003
language:
- en
tags:
- bert
- named-entity-recognition
- ner
- token-classification
- conll2003
- transformers
- educational
- huggingface-course
metrics:
- precision
- recall
- f1
- accuracy
model-index:
- name: bert-conll2003-ner
  results:
  - task:
      name: Token Classification
      type: token-classification
    dataset:
      name: CoNLL-2003
      type: conll2003
      split: validation
    metrics:
    - name: Precision
      type: precision
      value: 0.9369309716934282
    - name: Recall
      type: recall
      value: 0.9525412319084483
    - name: F1
      type: f1
      value: 0.9446716181256781
    - name: Accuracy
      type: accuracy
      value: 0.9869458998057338
---

# BERT CoNLL-2003 β€” Named Entity Recognition

A **BERT-based Named Entity Recognition (NER) model** fine-tuned from `bert-base-cased` on the **CoNLL-2003** dataset.

The model identifies and classifies named entities in English text into four entity categories:

**Person β€’ Organization β€’ Location β€’ Miscellaneous**

> This checkpoint is preserved as a complete educational token-classification experiment from my hands-on study of the Hugging Face Transformers ecosystem.

## Performance

The completed fine-tuning run achieved:

| Metric | Validation Result |
|---|---:|
| **F1** | **94.47%** |
| **Precision** | **93.69%** |
| **Recall** | **95.25%** |
| **Accuracy** | **98.69%** |
| Evaluation loss | 0.0662 |

These are the evaluation results preserved with the original training run.

## Model Details

| Property | Value |
|---|---|
| Architecture | `BertForTokenClassification` |
| Base model | `bert-base-cased` |
| Task | Named Entity Recognition |
| Dataset | CoNLL-2003 |
| Language | English |
| Transformer layers | 12 |
| Hidden size | 768 |
| Attention heads | 12 |
| FFN dimension | 3,072 |
| Maximum sequence length | 512 |
| Vocabulary size | 28,996 |
| Output labels | 9 |
| Weight precision | FP32 |

The saved configuration explicitly identifies the architecture as `BertForTokenClassification`.

## Entity Labels

The checkpoint uses the standard BIO-style CoNLL-2003 label scheme:

| ID | Label | Meaning |
|---:|---|---|
| 0 | `O` | Outside an entity |
| 1 | `B-PER` | Beginning of person |
| 2 | `I-PER` | Inside person |
| 3 | `B-ORG` | Beginning of organization |
| 4 | `I-ORG` | Inside organization |
| 5 | `B-LOC` | Beginning of location |
| 6 | `I-LOC` | Inside location |
| 7 | `B-MISC` | Beginning of miscellaneous entity |
| 8 | `I-MISC` | Inside miscellaneous entity |

These mappings are stored directly in the model configuration.

## How It Works

```text
Input sentence
      ↓
BERT WordPiece tokenizer
      ↓
BERT encoder
      ↓
token-level classifier
      ↓
BIO entity labels
      ↓
PER / ORG / LOC / MISC
```

Unlike sequence classification, NER makes a prediction for individual tokens in the input.

## Quick Start

```python
from transformers import pipeline

MODEL_ID = "rIsHu009/bert-conll2003-ner"

ner = pipeline(
    "token-classification",
    model=MODEL_ID,
    aggregation_strategy="simple",
)

text = (
    "Satya Nadella works at Microsoft "
    "and visited London."
)

entities = ner(text)

for entity in entities:
    print(
        entity["entity_group"],
        entity["word"],
        round(entity["score"], 4),
    )
```

A typical output structure is:

```text
PER  Satya Nadella
ORG  Microsoft
LOC  London
```

Actual predictions and confidence scores depend on the input and checkpoint.

## Direct Model Usage

```python
from transformers import (
    AutoTokenizer,
    AutoModelForTokenClassification,
)

MODEL_ID = "rIsHu009/bert-conll2003-ner"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)

model = AutoModelForTokenClassification.from_pretrained(
    MODEL_ID
)
```

## Training Configuration

The preserved Trainer metadata records:

| Hyperparameter | Value |
|---|---:|
| Learning rate | `2e-5` |
| Train batch size | `16` |
| Evaluation batch size | `16` |
| Seed | `42` |
| Optimizer | AdamW |
| LR scheduler | Linear |
| Epochs | `3` |



## Training Progress

Performance improved across the three epochs:

| Epoch | Validation Loss | Precision | Recall | F1 | Accuracy |
|---:|---:|---:|---:|---:|---:|
| 1 | 0.0650 | 0.9241 | 0.9428 | 0.9334 | 0.9853 |
| 2 | 0.0698 | 0.9363 | 0.9472 | 0.9417 | 0.9860 |
| 3 | 0.0662 | **0.9369** | **0.9525** | **0.9447** | **0.9869** |

The strongest preserved F1 score is **0.9447 at epoch 3**.

### Historical software environment

- Transformers `4.51.3`
- PyTorch `2.6.0+cu124`
- Datasets `3.6.0`
- Tokenizers `0.21.1`



## Tokenization

The checkpoint uses the **cased BERT WordPiece tokenizer**.

Important properties:

```text
Tokenizer: BertTokenizer
Maximum length: 512
Lowercasing: disabled
```

Preserving capitalization is particularly useful for NER because capitalization can provide information about names, organizations and locations.

The saved tokenizer confirms a 512-token limit and that lowercasing is disabled. 

## Dataset

The model was fine-tuned on **CoNLL-2003**, a standard benchmark for English named entity recognition.

The checkpoint predicts four entity types:

- **PER** β€” people
- **ORG** β€” organizations
- **LOC** β€” locations
- **MISC** β€” miscellaneous named entities

The original training metadata explicitly records CoNLL-2003 as the dataset and validation split used for the reported metrics.

## Intended Use

This checkpoint is useful for:

- named entity recognition;
- token-classification experiments;
- extracting people, organizations and locations from English text;
- learning BERT fine-tuning;
- studying BIO tagging;
- learning Hugging Face token-classification workflows;
- educational NLP applications.

## Limitations

The model may:

- miss entities not well represented by CoNLL-2003;
- confuse entity categories;
- perform worse on modern slang or informal text;
- struggle with domain-specific terminology;
- produce fragmented entities because of subword tokenization;
- perform differently on text distributions unlike the benchmark data.

The reported **94.47% F1** is specific to the preserved CoNLL-2003 validation evaluation and should not be interpreted as universal NER performance.

Human review is recommended for consequential extraction tasks.

## Learning Context

This model represents the **Named Entity Recognition / token-classification stage** of my Hugging Face learning progression.

The broader collection includes experiments with:

```text
BERT / DistilBERT
        ↓
token classification
        ↓
question answering
        ↓
masked language modeling
        ↓
machine translation
        ↓
causal language modeling
        ↓
Trainer / Accelerate workflows
```

The repositories are preserved as reproducible learning artifacts rather than presented as production systems.

## Repository Contents

The repository includes:

- `model.safetensors`
- `config.json`
- `tokenizer.json`
- `tokenizer_config.json`
- `vocab.txt`
- special-token configuration
- historical Trainer arguments
- TensorBoard training artifacts

## Author

**Naman Chanana**

- Hugging Face: `rIsHu009`
- GitHub: `Rishy-09`

---

*Educational named-entity-recognition artifact preserved as part of an ongoing study of NLP, LLMs, and the Hugging Face ecosystem.*