Download src/processors/nlp/natural_language_processing.py from Partha11/ml-server: direct link, hf CLI and curl.
- Browser
- Download file 370 Bytes
-
https://huggingface.co/spaces/Partha11/ml-server/resolve/main/src/processors/nlp/natural_language_processing.py
- Command line
-
hf download hf://spaces/Partha11/ml-server/src/processors/nlp/natural_language_processing.py
-
curl -L -o natural_language_processing.py https://huggingface.co/spaces/Partha11/ml-server/resolve/main/src/processors/nlp/natural_language_processing.py
370 Bytes
| import string | |
| def preprocess_bn(txt): | |
| """ | |
| This functions is used for preprocessing Bangla text. | |
| Two major preprocessing is done- | |
| 1. Punctuations removal. | |
| 2. Whitespace removal. | |
| Processed text is returned as a return value. | |
| """ | |
| for punc in string.punctuation: | |
| txt=txt.replace(punc, '') | |
| txt=txt.replace('।', '') | |
| txt=' '.join(txt.split()) | |
| return txt |