Spaces:
Build error
Build error
Download tools/text_cleaner.py from prashantpatil3299/ProjectLensAI: direct link, hf CLI and curl.
- Browser
- Download file 152 Bytes
-
https://huggingface.co/spaces/prashantpatil3299/ProjectLensAI/resolve/main/tools/text_cleaner.py
- Command line
-
hf download hf://spaces/prashantpatil3299/ProjectLensAI/tools/text_cleaner.py
-
curl -L -o text_cleaner.py https://huggingface.co/spaces/prashantpatil3299/ProjectLensAI/resolve/main/tools/text_cleaner.py
152 Bytes
| import re | |
| def clean_text(text: str) -> str: | |
| text = re.sub(r"\n{3,}", "\n\n", text) | |
| text = re.sub(r"[ \t]+", " ", text) | |
| return text.strip() |