MyProfileAvatar / src /name_extractor.py
Mariusz47's picture
chat created with new logic
f5f1397
raw
history blame contribute delete
232 Bytes
from gliner2 import GLiNER2
def extract_name_gliner(text: str) -> str:
extractor = GLiNER2.from_pretrained("fastino/gliner2-base-v1")
result = extractor.extract_entities(text[:700], ["person"])
return result["entities"]