GLiNER2
Safetensors
English
French
Spanish
extractor
Text classification
Named Entity Recognition
Relation Extraction
Intent classification
Sentiment Analysis
Topic classification
Structured extraction
Json extraction
Instructions to use fastino/gliner2-large-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use fastino/gliner2-large-v1 with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("fastino/gliner2-large-v1") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
Obtain entity offsets
#1
by vertex-cover - opened
Hi! Is there a way to obtain the entity offsets of the recognized entities in the original text?
entities = self.model.extract_entities(
string,
self.supported_entities,
threshold=self.threshold,
include_confidence=True,
include_spans=True,
)
Yes, you just need to enable include_spans.