Download tasks/segmentation.py from namfam/Ling: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/spaces/namfam/Ling/resolve/main/tasks/segmentation.py
- Command line
-
hf download hf://spaces/namfam/Ling/tasks/segmentation.py
-
curl -L -o segmentation.py https://huggingface.co/spaces/namfam/Ling/resolve/main/tasks/segmentation.py
319 Bytes
| from utils.remote_client import execute_remote_task | |
| def text_segmentation(text: str, model: str = "") -> str: | |
| resp = execute_remote_task("segmentation", {"text": text, "model": model}) | |
| if "error" in resp: | |
| return "Oops! Something went wrong. Please try again later." | |
| return resp.get("segments", "") | |