ml-server / src /processors /nlp /natural_language_processing.py
Partha11's picture
added project files from private repo
ae2ef1b
raw
history blame contribute delete
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