Please return the hidden state vectors for all found spans when requested
Use case
Reusing GLiNER span embeddings as features for a downstream model: run zero-shot extraction, then feed the embedding of each detected span into a separate classifier/retrieval model, instead of re-encoding the span text with another encoder. The embeddings are already contextual and already aligned with the label space, so this is cheap and natural — if they were reachable.
for entity in entities:
label: str = entity['label']
text: str = entity['text']
score: float = entity['score']
# vector!
vector: np.ndarray = entity['vector']
Please return the hidden state vectors for all found spans when requested
Use case
Reusing GLiNER span embeddings as features for a downstream model: run zero-shot extraction, then feed the embedding of each detected span into a separate classifier/retrieval model, instead of re-encoding the span text with another encoder. The embeddings are already contextual and already aligned with the label space, so this is cheap and natural — if they were reachable.