Spaces:
Paused
Paused
Download src/name_extractor.py from Ephraimmm/Avatar-chat: direct link, hf CLI and curl.
- Browser
- Download file 237 Bytes
-
https://huggingface.co/spaces/Ephraimmm/Avatar-chat/resolve/main/src/name_extractor.py
- Command line
-
hf download hf://spaces/Ephraimmm/Avatar-chat/src/name_extractor.py
-
curl -L -o name_extractor.py https://huggingface.co/spaces/Ephraimmm/Avatar-chat/resolve/main/src/name_extractor.py
237 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"] |