A Gentle Introduction to Natural Language Processing

This gentle introduction to NLP covers the basics, and will help you move along to more advanced topics ASAP.



A Gentle Introduction to Natural Language Processing
Photo by Ryan Wallace on Unsplash

 

Introduction 

 

While in data processing, data acquisition, data sorting, and even data manipulation, there are some inputs involved that are required by the computer from the machine and there are certain outputs that the machine tells the user all of these are in the form of certain language. This language is different and difficult to understand by both humans and machines. In order to code the input and make it easier for machines to understand and vice versa, there are certain languages involved which are known as computer programming. All of these come under the wide field of natural language processing with the help of which the coding language is translated in the form of binary so that the machine can understand, and the binary language is being decoded and making it understandable for the human. (Nadkarni et al., 2011) Natural language processing is categorized as the subfield of artificial intelligence. A slight demonstration has been shown in the following block diagram which enables us to understand how this NLP is related to AI. 

 

understand how this NLP is related to AI
Figure 1. A Relationship between AI, ML, DL, and NLP (An easy representation) (Natural Language Processing: Taking Your Business to the Next Level, Sept 2021)

 

Examples related to NLP

 

In our daily life while dealing with technologies we have come across different examples in which natural language processing is implemented. A few of the examples related to NLP are as follows. 

  1. Data analytics is used by statistics analysis technicians in order to make data about weather, crime in a city, traffic signal situation, etc. In simple words, in data entry, it is very important.
  2. Predictive Texting, while using a mobile phone certain words pop up all by themselves that is because of the users using that word more often, and also there are certain other algorithms involved too. This requires national language processing and AI.
  3. Email Filters, the most basic feature in national language processing.
  4. Search Results, Google search results also use NLP to refine search for users based on user history and data history. 
  5. The other examples are digital phone calls, smart assistance, and language translations. (Zhao et al., 2019) 

 

Mathematics in NLP

 

While talking about mathematics in NLP, mathematics itself is a vast field and there are so many branches of it. For a person who is willing to continue his research in the field of NLP and its modeling technique, he must have a knowledge of three basic mathematics which are linear algebra, calculus, probability, and some basic knowledge of stats. The main question that arises here is whether it will require a lot of mathematics for the field of natural language processing. The answer to this question depends on the target you want to achieve. Some branches of NLP require a lot of mathematics while others need basic math. (A Learning Path To Becoming A Natural Language Processing Expert | by Sara A. Metwalli | Towards Data Science, 2021) 

NLP contains chunks of machine learning, deep learning, and computer vision. In simple words, while working on NLP there is a lot of possibilities that the certain machine or the system logged all the data from the user input. This can be explained using a simple example. As discussed earlier in autocorrect in our mobile phones NLP is involved. When you type certain words like “I live in” the sentence completion algorithm of your mobile phone based on your recent activities shows “Los Angeles”. This all has related to some backpropagation, linear algebra, and statistics tools. Backpropagation works when the user used different words. For example, when we write initially “I live in” the sentence completion shows us New York, after certain typing and writing the system knows that after the user writes “Los Angeles”, now after every in the system shows us “Los Angeles” even if the in is used in some other sentence. After a certain amount of time when the user does not use the word “Los Angeles” after the word “in” now the system has trained up to that extent that it knows that I should show “Los Angeles” when the user writes “live in” otherwise use other words which are used more often in the writing or chatting. This is the prime example of backpropagation in NLP. In simple words, adjustment of weights in neural networks and minimizing error is complete math. (NLP Text Similarity, How It Works and the Math behind It | by Jaskaran S. Puri | Towards Data Science, 2018)

 

 A simple Representation of Back Propagation
Figure 2. A simple Representation of Back Propagation (An Introduction to Backpropagation Algorithm and How It Works? 2020)

 

Similarly, statistics have been used in NLP in order to record the data of the user and make complete data of which words are used by the user more often. For example, a user starts a conversation using “Hello”. Now every time a user opens messenger or WhatsApp there is a hello that appears at the beginning. This all is possible due to the recent data recorded by the system and texts show up according to the style adopted by the user. This statistical analysis of the data of the user has also used probability distribution as well. For example, with proper training and error removal, and backpropagation the system gets trained so well that it came up with exciting suggestions. Another example of the involvement of probability and statistics in NLP is google search history or YouTube search history. The basic aim of statistical NLP is to take some data having some unknown probability distribution and make some interference about it having some known probability distribution. Now with the help of these results from probability distribution statistical data has been calculated and refined search has been obtained just as mentioned earlier in google search type platforms etc. (What Is Natural Language Processing?, 2017)

 

Input, Outputs, and Input from user required for training an NLP System
Figure 3. Input, Outputs, and Input from user required for training an NLP System (Friedman et al., 2013)

 

References

 

  1. A Learning Path To Becoming A Natural Language Processing Expert | by Sara A. Metwalli | Towards Data Science. (n.d.). Retrieved January 26, 2022, from https://towardsdatascience.com/a-learning-path-to-becoming-a-natural-language-processing-expert-725dc67328c4
  2. An Introduction to Backpropagation Algorithm and How it Works? (n.d.). Retrieved January 26, 2022, from https://www.mygreatlearning.com/blog/backpropagation-algorithm/
  3. Friedman, C., Rindflesch, T. C., & Corn, M. (2013). Natural language processing: State of the art and prospects for significant progress, a workshop sponsored by the National Library of Medicine. Journal of Biomedical Informatics, 46(5), 765–773. https://doi.org/10.1016/J.JBI.2013.06.004
  4. Nadkarni, P., … L. O.-M.-J. of the, & 2011,  undefined. (n.d.). Natural language processing: an introduction. Academic.Oup.Com. Retrieved January 26, 2022, from https://academic.oup.com/jamia/article-abstract/18/5/544/829676
  5. Natural Language Processing: Taking Your Business to the Next Level. (n.d.). Retrieved January 26, 2022, from https://datacenterfrontier.com/natural-language-processing-how-this-technique-can-take-your-business-to-the-next-level/
  6. NLP Text Similarity, how it works and the math behind it | by Jaskaran S. Puri | Towards Data Science. (n.d.). Retrieved January 26, 2022, from https://towardsdatascience.com/nlp-text-similarity-how-it-works-and-the-math-behind-it-a0fb90a05095
  7. What Is Natural Language Processing? (n.d.). Retrieved January 26, 2022, from https://machinelearningmastery.com/natural-language-processing/
  8. Zhao, W., Peng, H., Eger, S., … E. C. preprint arXiv, & 2019,  undefined. (n.d.). Towards scalable and reliable capsule networks for challenging NLP applications. Arxiv.Org. Retrieved January 26, 2022, from https://arxiv.org/abs/1906.02829

 
 
Neeraj Agarwal is a founder of Algoscale, a data consulting company covering data engineering, applied AI, data science, and product engineering. He has over 9 years of experience in the field and has helped a wide range of organizations from start-ups to Fortune 100 companies ingest and store enormous amounts of raw data in order to translate it into actionable insights for better decision-making and faster business value.