An Introduction to NLP

Intro To Nlp Cover Image

Natural Language Processing (NLP) is a part of Computer Science, more particularly of Artificial Intelligence that deals with the interaction of computers with humans in natural languages. Humans use natural languages as a means of communication.

Natural language processing aims to make computers understand natural languages as humans do and also generate them.
Computers can understand structured data like tables in a database, but human languages are in the form of text and voice and these are unstructured forms of data. NLP applications range from voice assistants like Apple’s Siri to concepts like machine translation, text filtering, etc.

In this article, we’ll be getting an overview of natural language processing.


Is NLP difficult?

Human languages are complex. The same thing can be conveyed in different ways in human language. The words used in a sentence can have different meanings depending on the context and their usage.

It is required to know the context beforehand in order to derive the correct meaning of the sentence. Speech, gestures and voice also play an important role in communicating through human languages. NLP is difficult because languages contain ambiguity and uncertainty. All of these are some challenges for natural language processing.


Components of NLP

Natural Language Processing has the following 2 components:

  1. Natural Language Understanding
    Natural Language Understanding refers to a computer’s ability to understand human languages. It is the process of rearranging unstructured data so that the computer can understand it.
  2. Natural Language Generation
    Natural Language Generation is the process of producing human-readable text from structured or unstructured data.

NLP Techniques

Let’s have a look at the commonly used natural language processing techniques. These include syntactic techniques like stemming, lemmatization, parts of speech tagging, and tokenization as well as semantic techniques like named entity recognition and stop words removal.

Stemming

Stemming reduces a word to its stem i.e. root or base form. It is done by removing any affixes added to a word.

Stemming
Stemming

Lemmatization

Lemmatization is the process of converting words into their root word. It is done with the help of parts of speech tagging and the context of the sentence to determine the root of the word.

Lemmatization
Lemmatization

Tokenization

A token is anything that represents a word or a part of it. This implies that even characters can be considered tokens. Tokenization is the process of breaking down sentences into individual words and storing them.

Tokenization
Tokenization

POS tagging

Parts of Speech (POS) tagging is important for syntactic and semantic analysis as a single word can have multiple meanings in a given sentence. In such a case, it is needed to know the specific meaning of the word for the computer to handle it appropriately.

Pos Tagging
POS Tagging

Named Entity Recognition

Named Entity Recognition (NER) in NLP refers to the process of classifying words into subcategories. The NER model starts by identifying the entity of interest, and then categorizing it into the most suitable class. Here is a list of some of the most common types of Named Entities:

  • Person
  • Organization
  • Date
  • Place
Ner
Named Entity Recognition

Stop words removal

A stop word is a commonly used word in a sentence. Examples of stop words are ‘is’, ‘the’, ‘in’, ‘a’, ‘an’, etc. These are added to make the sentence grammatically correct but have little to no importance while developing a model, so we remove them. This also reduces the size of the dataset.

Stop Words Removal
Stop Words Removal

Recommended Read: Python libraries used for NLP


Applications of NLP

Below are some of the most common applications of NLP that we use in our day-to-day life.

Message Filters

The very common application of NLP is message filtering. This means categorising the messages into different classes like spam, social, promotions, etc. based upon the presence of some keywords. The most popular application of this technique is found in Gmail.

Language Translation

Translation tools like Google translate use natural language processing to translate the given sentences from one language to another.

Virtual Assistants

Virtual assistants can not only understand the commands given in a natural language but also talk to you in the same language. Examples of such assistants are Alexa, Siri, Google Home, etc.

Autocomplete

Features like autocorrect, autocomplete and predictive text are common in our smartphones. They respectively correct the spellings, complete the words and predict or suggest the next word in the sentence by looking at the sentence typed so far. All these features make use of NLP.


Conclusion

Natural Language Processing is a subfield of artificial intelligence that deals with helping machines understand natural languages. There are many vast applications of NLP in the digital world and it has helped improve human-computer interaction in innovative ways.