What is Natural Language Processing?

Nivan Gujral
7 min readDec 31, 2019

Natural Language Processing sounds like a complicated technology that only large companies have. In reality, Natural Language Processing is super common and everyone has it and uses it every day. Natural Language Processing is found everywhere such as on phones, virtual assistants, Google and many others.

Natural Language Processing is a technology where a computer learns human text or speech by using AI algorithms. There are two methods of processing the human language by computers, Text-based Processing and Speech-Based Processing.

What is Text-Based Processing?

Text-Based Processing is where a computer looks at text and learns how to understand it. Text-Based Processing is used in Google Translate, Search Engines and anything that has to do with understanding text. Some companies that use Natural Language Processing are Yummly, Gmail, English Central, and many others. They use Text-Based processing to make searches, block spam emails and to teach users about a language.

How does Text-Based Processing work?

It is really easy for humans to understand text written down but it is not so simple for a computer. They do not think out of the box like humans do but computers think logically. In order for the computer to understand text, it follows a Natural Language Processing Pipeline.

The first step is to take the text and split it up into sentences. For example with the paragraph down below, the computer will look for the start and ends of the sentences by looking for a capital letter and a period.

Then the computer will take each sentence and split it into words and punctuation. For example, with the sentence “London is the capital and most populous city of England and the United Kingdom.” the computer would make it into “London”, “is”, “the”, “capital”, “and”, ”most”, “populous”, “city”, “of”, “England”, “and”, “the”, “United”, “Kingdom”, “.”

After splitting the sentences into words the computer will determine which part of speech is each word. For example with the word “London”, the computer would define it as a proper noun.

Then the computer will see if the word has different forms. For example, the word “had” is similar to the word “have” and the word “city” is similar to the word “cities” but they have different spellings. So the computer will take the sentence and replace it with the original word. For example, if the sentence is “I had two ponies” the computer would change the sentence to “I [have] two [pony]”.

After the computer makes the words into its original form the computer will then flag all of the filler words. Filler words are words that have no meaning such as “and”, “a”, and “the”. The way the computer determines the word is a filler word is by checking in a list because some filler words could be a tile of something. For example the band “The The!” has a filler word and if the computer ignored those then the person would not get the right results.

Then the computer will start to see which words match with each other and will make a root tree with them by using machine learning. For example with the sentence “London is the capital and most populous city of England and the United Kingdom”, the computer would make this root tree:

Then the computer will place the words with a similar idea next to each other. For example with the sentence “London is the capital and the most populous city” the computer will take common ideas of the sentence and group them together.

Then the computer will give each word an entity and then find out what that word means by using an NER (Named Entity Resolution) training model. For example, it would give the word “London” the entity of “Geographical Location”. Then it would find the meaning of the word by looking through a dictionary.

Then the last step for the computer to do is to figure out which pronoun belongs to which word. It is really easy for a human to understand what the pronoun is in this sentence “John is walking. He is a very fast walker” but for a computer not so much. The computer needs to look at the nouns before the pronoun to find out what the pronoun is.

🎉🎉 Then the computer has understood the text 🎉🎉

What is Speech-Based Processing?
Speech-Based Processing is similar to Text-Based Processing but in Speech-based Processing, the computer tries to understand speech and not text. Speech-Based Processing is used in virtual assistances such as Alexa, Siri, Google Home, and Cortana. Some companies using Speech-Based Processing are Microsoft, Apple, Amazon, Google, and many others.

How does Speech-Based Processing work?

In order for the computer to understand the speech that is being said it needs to obtain the speech. The way the computer obtains the speech is through an FCM (fuzzy C-means). Using FCM approach recorded sound waves are analyzed, which filters out the useless sound waves such as car noises and people talking in the background.

The computer will take the sound waves and look at 20 milliseconds segments. First, the computer will turn the sound waves into a graph by its frequencies.

After the computer graph the frequencies of the sound, the frequencies will go through a Recurrent Neural Network or RNN to find out the likeliness of the sound being each letter.

The computer will then graph the outcomes of the likeness of the letter and letters that might follow.

In this example, the real word is “hello” and the computer is predicting the word to be either “HHHEE_LL_LLLOOO”, “HHHUU_LL_LLLOOO” or even “AAAUU_LL_LLLOOO”. The computer will then compile the letters that are the same and next to each other. In this example, the outcomes could be “hello”, “hullo”, or “allo”. Then the computer will decide which of the words makes the most sense. In this case, the computer has chosen the word “hello” to make the most sense out of all three outcomes.

Like the Text-Based Processing, the computer will give each word an entity and then find out what that word means by using a NER training model. Then the computer has to figure out which pronoun belongs to which word. The computer will continue this process until it has got the whole message decoded.

🎉🎉 Then the computer has understood the speech🎉🎉

Why is Natural Language Processing important?

Natural Language Processing (NLP) helps to overcome language barriers. To convert information from one language to another form, machine translation can be used. NLP forms the basis of many language translators to help people communicate and collaborate across regions and cultures. It enables value add services like dictation to speed up documentation processes across industries.

Natural Language Processing helps computer to understand the meaning of text. They form the basis of learning from structure content whether its analyzing research papers to build new intelligent models for decision support or process clinical notes for a patient to understand their medical history to help in ongoing care.

As the amount of information available online is increasing day by day, the need to access and process it becomes more important. Making sense of various elements of information available in structured and unstructured form (text or speech) to better server a person is enabled through the use of Natural Language Processing. It enables key capabilities of artificial intelligence that is being leveraged in all parts of our lives.

Send me an email at nivangujral@gmail.com if you would like to further discuss this article or just talk.

Images from Adam Geity and Riti Dass

--

--