bert-ner-conll2003 / README.md
PassbyGrocer's picture
Upload BertForTokenClassification
e75aa6d verified
metadata
library_name: transformers
license: apache-2.0
base_model: bert-base-uncased
tags:
  - generated_from_trainer
datasets:
  - conll2003
metrics:
  - precision
  - recall
  - f1
  - accuracy
model-index:
  - name: bert-ner-conll2003
    results:
      - task:
          type: token-classification
          name: Token Classification
        dataset:
          name: conll2003
          type: conll2003
          config: conll2003
          split: validation
          args: conll2003
        metrics:
          - type: precision
            value: 0.9414244508542268
            name: Precision
          - type: recall
            value: 0.9493231905134802
            name: Recall
          - type: f1
            value: 0.9453573218960619
            name: F1
          - type: accuracy
            value: 0.9865601220074031
            name: Accuracy

bert-ner-conll2003

This model is a fine-tuned version of bert-base-uncased on the conll2003 dataset. It achieves the following results on the evaluation set:

  • Loss: 0.0631
  • Precision: 0.9414
  • Recall: 0.9493
  • F1: 0.9454
  • Accuracy: 0.9866

Model description

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = AutoModelForTokenClassification.from_pretrained("PassbyGrocer/bert-ner-conll2003")

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "My name is Wolfgang and I live in Berlin."

ner_results = nlp(example)
print(ner_results)

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Use 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: 5
  • mixed_precision_training: Native AMP

Training results

Training Loss Epoch Step Validation Loss Precision Recall F1 Accuracy
0.0844 1.0 878 0.0693 0.9029 0.9201 0.9114 0.9806
0.0216 2.0 1756 0.0559 0.9340 0.9444 0.9391 0.9854
0.0206 3.0 2634 0.0569 0.9436 0.9447 0.9442 0.9863
0.0141 4.0 3512 0.0634 0.9369 0.9488 0.9428 0.9860
0.0176 5.0 4390 0.0631 0.9414 0.9493 0.9454 0.9866

Framework versions

  • Transformers 4.46.1
  • Pytorch 1.13.1+cu116
  • Datasets 3.1.0
  • Tokenizers 0.20.1