bert-finetuned-ner

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

  • Loss: 0.2481
  • Model Preparation Time: 0.0021
                   precision    recall  f1-score   support

   B-COMMENT       0.88      0.90      0.89       767
      B-NAME       0.91      0.91      0.91      1050
       B-QTY       0.99      0.99      0.99       836
 B-RANGE_END       0.93      1.00      0.96        13
      B-UNIT       0.99      0.99      0.99       706
   I-COMMENT       0.93      0.96      0.95      1499
      I-NAME       0.92      0.84      0.88       572
       OTHER       0.88      0.82      0.85       439

    accuracy                           0.93      5882
   macro avg       0.93      0.93      0.93      5882
weighted avg       0.93      0.93      0.93      5882

Usage

In [40]: from transformers import pipeline

In [41]: 

In [41]: classifier = pipeline("token-classification", "AXKuhta/bert-finetuned-ner")
Loading weights: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 199/199 [00:00<00:00, 9724.08it/s]

In [42]: classifier.tokenizer.tokenize("mozzarella")
Out[42]: ['mozzarella']

In [43]: classifier("1 pound broccoli", aggregation_strategy="simple")
Out[43]: 
[{'entity_group': 'QTY',
  'score': np.float32(0.9997178),
  'word': '1',
  'start': 0,
  'end': 1},
 {'entity_group': 'UNIT',
  'score': np.float32(0.99991345),
  'word': 'pound',
  'start': 2,
  'end': 7},
 {'entity_group': 'NAME',
  'score': np.float32(0.999385),
  'word': 'broccoli',
  'start': 8,
  'end': 16}]

Training procedure

See bert_finetune_fin.ipynb

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 4e-05
  • train_batch_size: 16
  • eval_batch_size: 16
  • seed: 42
  • optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: linear
  • num_epochs: 6

Framework versions

  • Transformers 5.6.2
  • Pytorch 2.11.0+cu126
  • Datasets 3.6.0
  • Tokenizers 0.22.2
Downloads last month
130
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for AXKuhta/bert-finetuned-ner

Finetuned
(6678)
this model