Spaces:
Sleeping
Sleeping
Download src/preprocess.py from Sujith2121/Semantic-search-cache: direct link, hf CLI and curl.
- Browser
- Download file 161 Bytes
-
https://huggingface.co/spaces/Sujith2121/Semantic-search-cache/resolve/main/src/preprocess.py
- Command line
-
hf download hf://spaces/Sujith2121/Semantic-search-cache/src/preprocess.py
-
curl -L -o preprocess.py https://huggingface.co/spaces/Sujith2121/Semantic-search-cache/resolve/main/src/preprocess.py
161 Bytes
| import re | |
| def clean_text(text): | |
| text = text.lower() | |
| text = re.sub(r"\n+", " ", text) | |
| text = re.sub(r"\s+", " ", text) | |
| return text.strip() | |