example="I am a #king" print(remove_punct(example))
Spelling Correction
1
!pip install pyspellchecker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
from spellchecker import SpellChecker
spell = SpellChecker() defcorrect_spellings(text): corrected_text = [] misspelled_words = spell.unknown(text.split()) for word in text.split(): if word in misspelled_words: corrected_text.append(spell.correction(word)) else: corrected_text.append(word) return" ".join(corrected_text) text = "corect me plese" correct_spellings(text)
Use Glove
use GloVe pretrained corpus model to represent our words