lhoestq/conll2003
Viewer • Updated • 20.7k • 3.73k • 5
bert-base-cased used as a frozen feature extractor for named entity recognition on CoNLL-2003. Only the token-classification head was trained. This run was kept as the rejected alternative: full fine-tuning scored higher on the same test set.
train for learning, validation for checkpoint selection, test reported once.O, B-PER, I-PER, B-ORG, I-ORG, B-LOC, I-LOC, B-MISC, I-MISC.ner_tags as integers. Names follow the standard CoNLL-2003 order.bert-base-cased (110M), frozen. Trainable BERT parameters: 0. The head has 6,921 parameters.1e-3.[CLS], [SEP], and padding use -100 and are ignored by the loss.Test set, one evaluation after training:
| Precision | Recall | F1 | Train loss | Test loss |
|---|---|---|---|---|
| 0.7862 | 0.8086 | 0.7973 | 0.22 | 0.14 |
Validation entity F1 by epoch: 0.804, 0.820, 0.831. The saved checkpoint is the last epoch, which was also the best validation F1.
Full fine-tuning on the same data and seed reached a test F1 of 0.9114.
English named entity recognition on sentences similar to CoNLL-2003 newswire, when a frozen encoder is required. For accuracy, prefer the full fine-tuning model.
from transformers import AutoModelForTokenClassification, AutoTokenizer
repo_id = "karimepachecog/ner-bert-base-cased-feature"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForTokenClassification.from_pretrained(repo_id)
Base model
google-bert/bert-base-cased