Instructions to use Terrificfantasm/bert-base-uncased-ud-ewt-pos with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Terrificfantasm/bert-base-uncased-ud-ewt-pos with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Terrificfantasm/bert-base-uncased-ud-ewt-pos")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Terrificfantasm/bert-base-uncased-ud-ewt-pos") model = AutoModelForTokenClassification.from_pretrained("Terrificfantasm/bert-base-uncased-ud-ewt-pos", device_map="auto") - Notebooks
- Google Colab
- Kaggle
UD English EWT part-of-speech tagging
Selected method: partial_finetuning, epoch 3. The choice was fixed on validation data before test evaluation. This is a measured academic adaptation of BERT, not a production-validated system.
Training data and evaluation
UD English EWT r2.15, official 12,544 / 2,001 / 2,077 sentence splits. Integer-ID syntactic words only; skip multiword surface rows and empty nodes. Exact overlaps retained: 36 / 47 / 27 across train/val, train/test, val/test.
Validation word accuracy; test word accuracy and macro-F1 over all 17 UPOS tags.
BERT-base-uncased with a linear 17-class head. First-subtoken supervision; other positions use -100. No truncation; dynamic padding.
The table preserves native scales: AG News, NER and POS metrics are in [0, 1]; QA EM/F1 are in [0, 100]. Training seconds exclude validation, saving and final evaluation.
| method | best_epoch | trainable_parameters | train_seconds | test_token_accuracy | test_macro_f1 |
|---|---|---|---|---|---|
| frozen | 3 | 13073 | 79.851557 | 0.932295 | 0.865129 |
| partial_finetuning | 3 | 14188817 | 110.286533 | 0.957320 | 0.897513 |
Optimization and reproducibility
Three epochs, seed 42. AdamW: head LR 1e-3, trainable encoder LR 2e-5, weight decay 0.01, 10% linear warmup, clipping 1.0. Effective batch size 16. A partial method trains only the last two encoder layers and head; lower layers are frozen in evaluation mode. Frozen weights were checked for invariance. Full fine-tuning updates all parameters.
Base model revision: 86b5e0934494bd15c9632b12f734a8a67f723594. Dataset revision: r2.15. Detailed configuration is in training_config.json; the complete comparison is in evaluation.json. The included experiment source and requirements-lock.txt document the original environment. Use a new output directory when reproducing. QA source includes the documented UTF-8 JSON read fix; it did not change any training weights.
Only one seed was evaluated. Small gaps may reflect initialization, dropout and ordering variability; no statistical significance is claimed. Training hardware: RTX 4060 Ti, CUDA bf16. Training runtime is not inference latency.
Intended use and limitations
English grammatical tagging of pretokenized words.
Accuracy gap is within the assignment seed-variation caution. Uncased input loses capitalization information. Not evaluated on Spanish or other domains.
Loading the delivered model
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
repo = 'Terrificfantasm/bert-base-uncased-ud-ewt-pos'
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForTokenClassification.from_pretrained(repo).eval()
words = ['John', 'works', 'in', 'London', '.']
batch = tokenizer(words, is_split_into_words=True, return_tensors='pt')
with torch.no_grad():
ids = model(**batch).logits[0].argmax(-1).tolist()
seen = set()
for i, word_id in enumerate(batch.word_ids()):
if word_id is not None and word_id not in seen:
print(words[word_id], model.config.id2label[ids[i]])
seen.add(word_id)
Use pretokenized words and first-subtoken predictions to match the benchmark. Generic aggregation pipelines may produce different results.
Source terms and references
The upstream BERT checkpoints identify Apache-2.0 licensing. UD English EWT r2.15 is distributed under CC BY-SA 4.0. Dataset terms are separate from the base checkpoint license. This repository does not redistribute the training corpus. It preserves upstream attribution without asserting a new blanket license over all data sources.
- Base checkpoint: https://huggingface.co/google-bert/bert-base-uncased
- Data source: https://github.com/UniversalDependencies/UD_English-EWT/tree/r2.15
- Devlin et al., BERT: https://arxiv.org/abs/1810.04805
- Transformers training: https://huggingface.co/docs/transformers/training
- Downloads last month
- -
Model tree for Terrificfantasm/bert-base-uncased-ud-ewt-pos
Base model
google-bert/bert-base-uncased