This model is a fine-tuned version of
bert-base-uncased on the CoNLL-2003 dataset for Named Entity Recognition (NER).
This model has been trained to perform Named Entity Recognition (NER) and is based on the BERT architecture. It was fine-tuned on the CoNLL-2003 dataset, a standard dataset for NER tasks.
-
Training Dataset: CoNLL-2003
-
Training Evaluation Metrics:
| Label | Precision | Recall | F1-Score | Support |
|---------|-----------|--------|----------|---------|
| B-PER | 0.98 | 0.98 | 0.98 | 11273 |
| I-PER | 0.98 | 0.99 | 0.99 | 9323 |
| B-ORG | 0.88 | 0.92 | 0.90 | 10447 |
| I-ORG | 0.81 | 0.92 | 0.86 | 5137 |
| B-LOC | 0.86 | 0.94 | 0.90 | 9621 |
| I-LOC | 1.00 | 0.08 | 0.14 | 1267 |
| B-MISC | 0.81 | 0.73 | 0.77 | 4793 |
| I-MISC | 0.83 | 0.36 | 0.50 | 1329 |
| Micro Avg | 0.90 | 0.90 | 0.90 | 53190 |
| Macro Avg | 0.89 | 0.74 | 0.75 | 53190 |
| Weighted Avg | 0.90 | 0.90 | 0.89 | 53190 |
-
Validation Evaluation Metrics:
| Label | Precision | Recall | F1-Score | Support |
|---------|-----------|--------|----------|---------|
| B-PER | 0.97 | 0.98 | 0.97 | 3018 |
| I-PER | 0.98 | 0.98 | 0.98 | 2741 |
| B-ORG | 0.86 | 0.91 | 0.88 | 2056 |
| I-ORG | 0.77 | 0.81 | 0.79 | 900 |
| B-LOC | 0.86 | 0.94 | 0.90 | 2618 |
| I-LOC | 1.00 | 0.10 | 0.18 | 281 |
| B-MISC | 0.77 | 0.74 | 0.76 | 1231 |
| I-MISC | 0.77 | 0.34 | 0.48 | 390 |
| Micro Avg | 0.90 | 0.89 | 0.89 | 13235 |
| Macro Avg | 0.87 | 0.73 | 0.74 | 13235 |
| Weighted Avg | 0.90 | 0.89 | 0.88 | 13235 |
-
Test Evaluation Metrics:
| Label | Precision | Recall | F1-Score | Support |
|---------|-----------|--------|----------|---------|
| B-PER | 0.96 | 0.95 | 0.96 | 2714 |
| I-PER | 0.98 | 0.99 | 0.98 | 2487 |
| B-ORG | 0.81 | 0.87 | 0.84 | 2588 |
| I-ORG | 0.74 | 0.87 | 0.80 | 1050 |
| B-LOC | 0.81 | 0.90 | 0.85 | 2121 |
| I-LOC | 0.89 | 0.12 | 0.22 | 276 |
| B-MISC | 0.75 | 0.67 | 0.71 | 996 |
| I-MISC | 0.85 | 0.49 | 0.62 | 241 |
| Micro Avg | 0.87 | 0.88 | 0.87 | 12473 |
| Macro Avg | 0.85 | 0.73 | 0.75 | 12473 |
| Weighted Avg | 0.87 | 0.88 | 0.86 | 12473 |
-
Optimizer: AdamWeightDecay
- Learning Rate: 2e-05
- Decay Schedule: PolynomialDecay
- Warmup Steps: 0.1
- Weight Decay Rate: 0.01
-
training_precision: float32
1from transformers import create_optimizer
2
3batch_size = 32
4num_train_epochs = 2
5num_train_steps = (len(tokenized_conll["train"]) // batch_size) * num_train_epochs
6
7optimizer, lr_schedule = create_optimizer(
8 init_lr=2e-5,
9 num_train_steps=num_train_steps,
10 weight_decay_rate=0.01,
11 num_warmup_steps=0.1
12)
1from transformers import pipeline
2
3pipe = pipeline("token-classification", model="huseyincenik/conll_ner_with_bert")
4
5from transformers import AutoTokenizer, AutoModelForTokenClassification
6
7tokenizer = AutoTokenizer.from_pretrained("huseyincenik/conll_ner_with_bert")
8model = AutoModelForTokenClassification.from_pretrained("huseyincenik/conll_ner_with_bert")
9
This dataset was derived from the Reuters corpus which consists of Reuters news stories. You can read more about how this dataset was created in the CoNLL-2003 paper.