class
AutoModelForTokenClassification
extends
_BaseAutoClassAutoModelForTokenClassification()Auto-dispatching wrapper that loads a per-token classifier.
Resolves to {Family}ForTokenClassification for NER / POS-tagging
fine-tunes across BERT / RoFormer / Transformer.
Notes
The forward returns logits of shape (B, T, num_labels) and is
typically trained against (B, T) label tensors via
MaskedLMMixin.compute_lm_loss, which folds the sequence axis
into the batch axis for cross-entropy.
Examples
>>> from lucid.models import AutoModelForTokenClassification
>>> model = AutoModelForTokenClassification.from_pretrained("bert_base_token_cls")
>>> type(model).__name__
'BERTForTokenClassification'