Python ProgrammingPython Programming

How to correct spelling using TextBlob?

Sometimes tweets, reviews or any blog data may contain with typo errors, hence first we need to correct that data to reducing multiple copies of same words, which represents the same meaning.

TextBlob is required library for this recipe. Installing TextBlob on your computer is a very simple. You simply need to install it using pip.

pip install textblob

Spelling Correction using TextBlob

from textblob import TextBlob

data = "Natural language is a cantral part of our day to day life, and it's so antresting to work on any problem related to langages."

output = TextBlob(data).correct()
print(output)