--- language: - en license: mit library_name: transformers pipeline_tag: token-classification tags: - named-entity-recognition - ner - token-classification - roberta - conll2003 --- # RoBERTa CoNLL-2003 NER An encoder-only RoBERTa model fine-tuned for English Named Entity Recognition. ## Model details - Base model: `FacebookAI/roberta-base` - Dataset: `lhoestq/conll2003` - Task: Token classification / Named Entity Recognition - Labels: O, B-PER, I-PER, B-ORG, I-ORG, B-LOC, I-LOC, B-MISC, I-MISC - Maximum sequence length: 256 ## Training Fine-tuned using Hugging Face Transformers Trainer. Word-level labels are aligned to the first subword token. Special tokens and continuation subwords are ignored using label ID `-100`. ## Validation results ```json { "eval_loss": 0.04585767164826393, "eval_precision": 0.9423943897144765, "eval_recall": 0.9498485358465163, "eval_f1": 0.9461067806554354, "eval_accuracy": 0.99069350881975 } ``` ## Test results ```json { "test_loss": 0.153057262301445, "test_precision": 0.8865162734630618, "test_recall": 0.9114730878186968, "test_f1": 0.8988214753382803, "test_accuracy": 0.9791105846882739 } ``` ## Usage ```python from transformers import pipeline ner = pipeline( "token-classification", model="ullahhafeez321/roberta-conll2003-ner", aggregation_strategy="simple" ) print(ner("Hafeez works at Microsoft in Pakistan.")) ``` ## Repository contents This repository contains the fine-tuned model weights, model configuration with label mappings, tokenizer files, training information, and this model card.