data
TokenClassificationOutput
extends
ModelOutputTokenClassificationOutput(logits: Tensor, loss: Tensor | None = None, hidden_states: tuple[Tensor, ...] | None = None, attentions: tuple[Tensor, ...] | None = None)Output of any per-token classification head (NER, POS, chunking).
Attributes
Notes
Returned by every {Family}ForTokenClassification head. The
logits have the same rank as a masked-LM head's, but the last axis
is a label set rather than a vocabulary — the distinct type keeps
the two from being confused.
Examples
>>> import lucid
>>> from lucid.models import TokenClassificationOutput
>>> out = TokenClassificationOutput(logits=lucid.zeros(1, 128, 9))
>>> out.logits.shape # (B, T, num_labels)
(1, 128, 9)