Spaces:
Sleeping
Sleeping
Download app/utils/text.py from justKevv/recommendation-api: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/spaces/justKevv/recommendation-api/resolve/main/app/utils/text.py
- Command line
-
hf download hf://spaces/justKevv/recommendation-api/app/utils/text.py
-
curl -L -o text.py https://huggingface.co/spaces/justKevv/recommendation-api/resolve/main/app/utils/text.py
531 Bytes
| import re | |
| def clean_resume(text: str) -> str: | |
| """ | |
| Cleans the input resume text by removing URLs, special characters, | |
| and extra whitespace, and converting to lowercase. | |
| """ | |
| # Remove URLs | |
| text = re.sub(r'http\S+|www\S+', '', text) | |
| # Remove non-alphanumeric characters (keeps only letters and spaces) | |
| text = re.sub(r'[^A-Za-z\s]', '', text) | |
| # Convert to lowercase | |
| text = text.lower() | |
| # Remove extra whitespace | |
| text = re.sub(r'\s+', ' ', text).strip() | |
| return text | |