Token Classification
Transformers
TensorBoard
Safetensors
English
bert
named-entity-recognition
ner
conll2003
educational
huggingface-course
Eval Results (legacy)
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.
Instructions to use rIsHu009/bert-conll2003-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rIsHu009/bert-conll2003-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="rIsHu009/bert-conll2003-ner")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("rIsHu009/bert-conll2003-ner") model = AutoModelForTokenClassification.from_pretrained("rIsHu009/bert-conll2003-ner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Document BERT CoNLL-2003 NER model
Browse files123456789101112131415161718192021222324252627289 unmodified lines3839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293---library_name: transformerslicense: apache-2.0base_model: bert-base-casedtags:- generated_from_trainerdatasets:- conll2003metrics:- precision- recall- f1- accuracymodel-index:- name: bert-fineturned-nerresults:- task:name: Token Classificationtype: token-classificationdataset:name: conll2003type: conll2003config: conll2003split: validationargs: conll2003metrics:- name: Precisiontype: precision9 unmodified linesvalue: 0.9869458998057338---<!-- This model card has been generated automatically according to the information the Trainer had access to. Youshould probably proofread and complete it, then remove this comment. --># bert-fineturned-nerThis model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on the conll2003 dataset.It achieves the following results on the evaluation set:- Loss: 0.0662- Precision: 0.9369- Recall: 0.9525- F1: 0.9447- Accuracy: 0.9869## Model descriptionMore information needed## Intended uses & limitationsMore information needed## Training and evaluation dataMore information needed## Training procedure### Training hyperparametersThe following hyperparameters were used during training:- learning_rate: 2e-05- train_batch_size: 16- eval_batch_size: 16- seed: 42- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments- lr_scheduler_type: linear- num_epochs: 3### Training results| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy ||:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|| 0.022 | 1.0 | 878 | 0.0650 | 0.9241 | 0.9428 | 0.9334 | 0.9853 || 0.0018 | 2.0 | 1756 | 0.0698 | 0.9363 | 0.9472 | 0.9417 | 0.9860 || 0.0057 | 3.0 | 2634 | 0.0662 | 0.9369 | 0.9525 | 0.9447 | 0.9869 |### Framework versions- Transformers 4.51.3- Pytorch 2.6.0+cu124- Datasets 3.6.0- Tokenizers 0.21.11234567891011121314151617181920212223242526272829303132333435369 unmodified lines464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323---library_name: transformerslicense: apache-2.0pipeline_tag: token-classificationbase_model: google-bert/bert-base-caseddatasets:- eriktks/conll2003language:- entags:- bert- named-entity-recognition- ner- token-classification- conll2003- transformers- educational- huggingface-coursemetrics:- precision- recall- f1- accuracymodel-index:- name: bert-conll2003-nerresults:- task:name: Token Classificationtype: token-classificationdataset:name: CoNLL-2003type: conll2003split: validationmetrics:- name: Precisiontype: precision9 unmodified linesvalue: 0.9869458998057338---# BERT CoNLL-2003 β Named Entity RecognitionA **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.## PerformanceThe 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 LabelsThe 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```textInput 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```pythonfrom transformers import pipelineMODEL_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:```textPER Satya NadellaORG MicrosoftLOC London```Actual predictions and confidence scores depend on the input and checkpoint.## Direct Model Usage```pythonfrom transformers import (AutoTokenizer,AutoModelForTokenClassification,)MODEL_ID = "rIsHu009/bert-conll2003-ner"tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)model = AutoModelForTokenClassification.from_pretrained(MODEL_ID)```## Training ConfigurationThe 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 ProgressPerformance 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`## TokenizationThe checkpoint uses the **cased BERT WordPiece tokenizer**.Important properties:```textTokenizer: BertTokenizerMaximum length: 512Lowercasing: 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.## DatasetThe 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 entitiesThe original training metadata explicitly records CoNLL-2003 as the dataset and validation split used for the reported metrics.## Intended UseThis 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.## LimitationsThe 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 ContextThis model represents the **Named Entity Recognition / token-classification stage** of my Hugging Face learning progression.The broader collection includes experiments with:```textBERT / 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 ContentsThe 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.*
README.md+274-44