Skip to content

Instantly share code, notes, and snippets.

@amita-shukla
Created March 25, 2020 09:05
Show Gist options
  • Save amita-shukla/6bb6f3630fc99a468a8c52bf835b1a26 to your computer and use it in GitHub Desktop.
Save amita-shukla/6bb6f3630fc99a468a8c52bf835b1a26 to your computer and use it in GitHub Desktop.
def process_all(text):
text = remove_tags(text)
text = process_single_quote(text)
text = decontract(text)
text = remove_special_chars(text)
text = remove_more_than_single_space(text)
text = text.lower()
text = stem_sentence(text)
return text
@AmanAdastra
Copy link

This will be way shorter!!
def process_all(text):
funcs = [remove_tags,process_single_quote,decontract,remove_special_chars,remove_more_than_single_space,lower,stem_sentence]
for f in funcs:
text = f(text)
return text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment