BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Paper • 1810.04805 • Published • 33
lhoestq/conll2003bert-base-uncasedhead_lr: 1e-3body_lr: 2e-5seed: 42-100 mask for continuation and special tokens{
"loss": 0.0940466895699501,
"token_accuracy": 0.9868920787643886,
"precision": 0.925249169435216,
"recall": 0.937868328001347,
"f1": 0.9315160130445689,
"runtime": 8.1007,
"samples_per_second": 401.199,
"steps_per_second": 3.21,
"epoch": 3.0,
"method": "full",
"trainable_params": 108898569,
"total_train_seconds": 309.33441281318665
}
Headline Metric: Entity-level F1 = 0.9315
from transformers import pipeline
# 1. Initialize the NER pipeline
ner = pipeline(
task="token-classification",
model="Elpapudex/Ner-full",
aggregation_strategy="simple" # Groups sub-tokens into complete entity names
)
# 2. Text to test
text = "Sundar Pichai announced that Google is opening a new AI hub in London next October."
# 3. Run inference
results = ner(text)
# 4. Display detected entities
for entity in results:
print(f"Entity: {entity['word']} | Label: {entity['entity_group']} | Confidence: {entity['score']:.2%}")