Natural Language Processing (Part 40)-Autocorrect

Coursesteach
4 min readApr 21, 2024

📚Chapter5: Autocorrect and Mininum Edit Distance

Introduction

I’ll give you a brief overview of autocorrect and how it works. You will learn to identify misspelled words. What is an additive distance, and how to calculate probabilities of the correct word.

Sections

What is autocorrect.
How to autocorrect works.
Summary

Section 1- What is autocorrect.

Natural Language Processing with Probabilistic Models

Let’s get started with a simple definition. What is autocorrect? Autocorrect is an application that changes misspelled words into the correct ones. You probably know it very well already. You have it on your phone, tablet, and on your computer inside your document editors and email applications.

Natural Language Processing with Probabilistic Models

For example, it takes a sentence like this one, happy birthday deah friend, and corrects the misspelled word, deah, to a word that you probably intended to write, which in this context would be dear, correctly spelled D-E-A-R. But what if you typed deer instead of dear?

Natural Language Processing with Probabilistic Models

Here, you see the word is spelled correctly, but it’s context is incorrect. Well, unless your friend happens to be an actual deer, you will not test for this contextual error this week. As it’s a more sophisticated problem, you’ll get to learn
about that another time. Instead, this week you will only look for words that have been misspelled and make corrections to these. This involves a simple, it’s powerful model, as you will see. Let me show you an overview of how autocorrect works.

Natural Language Processing with Probabilistic Models

Section 2- How to autocorrect works.

There are four key steps. First, identify an incorrect word. Misspelling is one way to do this. Second, find strings 1, 2, 3 or n edit distances away. Don’t worry, you will learn about minimum edit
distance shortly.

Natural Language Processing with Probabilistic Models

For now, what’s important to know is that, if a string is one edit distance away from the string that you typed, it’s more similar to your string compared to a string that is two edit distances away.

Natural Language Processing with Probabilistic Models

Third, filter the strings for real words that are spelled correctly.

Natural Language Processing with Probabilistic Models

Fourth, calculate word probabilities, which tell you how likely each word is to appear in this context and choose the most likely candidate to be the replacement.

Natural Language Processing with Probabilistic Models

Summary

Now you have a better intuition for what is autocorrect and how it works. That’s good. Next you’ll take a closer look at the details for implementing each step so that you can begin to build the autocorrects model. Now you know how autocorrect works.

Please Follow and 👏 Clap for the story courses teach to see latest updates on this story

🚀 Elevate Your Data Skills with Coursesteach! 🚀

Ready to dive into Python, Machine Learning, Data Science, Statistics, Linear Algebra, Computer Vision, and Research? Coursesteach has you covered!

🔍 Python, 🤖 ML, 📊 Stats, ➕ Linear Algebra, 👁️‍🗨️ Computer Vision, 🔬 Research — all in one place!

Enroll now for top-tier content and kickstart your data journey!

Natural Language Processing with Probabilistic models

Stay tuned for our upcoming articles where we will explore specific topics related to NLP in more detail!

Remember, learning is a continuous process. So keep learning and keep creating and sharing with others!💻✌️

Note:if you are a NLP export and have some good suggestions to improve this blog to share, you write comments and contribute.

👉📚GitHub Repository

👉 📝Notebook

Ready to dive into data science and AI but unsure how to start? I’m here to help! Offering personalized research supervision and long-term mentoring. Let’s chat on Skype: themushtaq48 or email me at mushtaqmsit@gmail.com. Let’s kickstart your journey together!

Contribution: We would love your help in making coursesteach community even better! If you want to contribute in some courses , or if you have any suggestions for improvement in any coursesteach content, feel free to contact and follow.

Together, let’s make this the best AI learning Community! 🚀

To Do List

1- Collects Keys points from the blogs

👉WhatsApp

👉 Facebook

👉Github

👉LinkedIn

👉Youtube

👉Twitter

Source

1- Natural Language Processing with Probabilistic Models (Coursera)

--

--