
Sakshi introducing Dr. Sarang
This lesson gives you an overview on NLP and what are you going to learn in this course? After I describe the course structure, you will be guided to setup the development environment for practicing the code examples and projects in this course.
The course mainly uses NLTK (Natural Language ToolKit) for text-processing and other NLP tasks. NLTK is the popular and widely used NLP framework It has a suite of text processing libraries for many common tasks such as classification, tokenisation, stemming, tagging, parsing, semantic reasoning, and so on. We use Google Colab for the development. This is a Cloud-based Jyupter notebook that you can use with your free account. It also provides a free GPU access with a few restrictions. You will practice your first NLTK application in this lesson.
Each word in the given text is a likely candidate for a feature in machine learning. If the number of words is too large, which usually is the case, it will be a humongous task to train the model. Thus, reducing the vocabulary size becomes our first necessity in text processing. Also, it is important to understand the text contents to develop an effective model. In this lesson, you will learn to use few Python commands to remove the undesired words from a given text.
Machines understand only binary data. In NLP, your data is purely textual. This text data must be converted to binary before you can use it for training. Secondly, for model training you need to have few fields as features and one ore more target variables. In NLP applications, there are no distinct columns as in databases which can be used as features. So, we divide the entire text corpus into words or sentences depending on the type of NLP application. This entire process of converting text into word or sentence tokens and mapping them into a binary is called tokenisation. In this lesson, you will learn this tokenisation process along with the tokenizer implementations provided in nltk.
The tokenisation process that you learned in the previous lesson creates a huge number of tokens on even a fairly sized text corpus. Generally, in NLP applications, the size of corpus is very large running into thousands and millions of words. Each word is considered as a feature for model training. It will be impossible to train a model with millions of features. So, we need to reduce the vocabulary. And, that's what we do in normalisation. In this lesson, you will learn many techniques for normalizing the text. Starting with basic techniques, you will be taught advanced techniques like stemming and lemmitazation.
The text processing you learned so far used the raw text. The text that is read from the web contains embedded HTML code. These html tags must be removed to extract meaningful text that makes sense for machine training. In this lesson, you will learn various techniques of cleaning up html from web data.
This lesson will introduce you to the important techniques of converting textual data to binary. You will learn in-depth workings of Bag-of-Words and tf-idf along with their practical implementations provided in nltk library.
As you have learned several text pre-processing techniques, it is time now to get into the development of real life projects. The course describes the development of five such projects covering a wide span of NLP applications. This short lecture briefs you on this upcoming five projects.
This is your first NLP application. In this project, you will apply your knowledge of text processing that you acquired so far through previous lessons. The application is trivial, categorizing the tweets into abusive and non-abusive. It is a binary classification problem. Importantly, through the development of this trivial application, you will learn how to develop machine learning models on a textual data. So far you would have developed ML models on numeric data. This project now sets your path for developing ML models on text corpus.
In the previous lesson, you learned the model development for binary classification. In this project, you will learn how to develop a multi-class classification model on a huge text corpus. We will use supervised learning for model development. The business problem is to classify the research articles based on the contents of their abstracts into different categories (subjects) such as Computer Science, Physics, Machine Learning, etc. You will use the K-nearest neighbor (KNN) algorithm for classification.
In the previous two projects, you learned to develop ML models for binary and multi-class classifications. In this project, you will use another Machine Learning algorithm and that is support vector machines for developing a multi-class classification model. The business use case is to rank the hotels based on their past customer reviews. For training, we will provide a few reviews for each hotel along with its ranking. The keywords in the reviews become our features and the rank is a target. The rank is assigned on a scale of 1 through 5. Your task is to detect the important keywords in reviews and create an association between these words and the rank. Once these associations are established, a new hotel can be ranked easily and that is what we call model's inference on unseen data. So, in this application, you will learn an important aspect of another kind of NLP application.
In the previous three projects, you learned the binary and multi-class classifications. In this project, you will learn an altogether different kind of requirement for NLP application. You are asked to develop a summary of a large text corpus. On the back cover of every printed book, you find a short summary of what the book is about. A prospective buyer usually reads this first before scanning through the book. Generating an eye-catching summary is an art. Can we use machines for generating such summaries? This is what you would learn in this project - summarizing a large corpus into a one-page document. You will use your learning of finding word frequencies to isolate the important sentences from a huge corpus.
This is the fifth project in our course that covers another important aspect of NLP applications. The business use case is to categorize the news items into different categories such as sports, politics, etc. The project teaches you an important technique of unsupervised clustering. You will use LatentDirichletAllocation (LDA) for clustering.
The NLP applications that you learned so far missed out on one important factor in the textual data and that is understanding its context. We so far gave importance to the frequently occurring words. However, in applications like language translation, the position of the words in a sentence has vital meaning. The same word appearing in two different places in the same sentence conveys an altogether different meaning to the reader. In this lesson, you will learn to tag the words based on the Part-of-Speech (POS), that is where they appear in a sentence. This tagging later helps in developing applications that understand natural language speech. This is now termed Natural Language Understanding (NLU). Learning PoS is the first step towards NLU. In this lesson, you will learn various techniques of tagging through PoS.
As you have seen through previous lessons and projects, the text corpus and thus the features count is usually extremely large in NLP applications. You learned several techniques of reducing the vocabulary size and tagging the words. To reduce this count further and to focus on the really important keywords, you use chunking and chinking. in this chapter, you will learn these techniques - a forward step to NLU.
We now come to the end of this course. You have now learned developing a wide range of NLP applications through real-life projects. These basics would create a foundation for you to learn the most advanced modern NLP techniques like Transformers, BERT, and so on. The course concludes with the future directions to your learning.
Traditional Machine Learning projects use numeric and textual data stored in conventional databases. Developing intelligent applications based on purely text data is extremely challenging? Why is it so? In the first place, the available text data in this world is millions of times more than the numeric data available to us in the conventional databases. So, the question is can we extract some useful information from this huge corpus of text data - which can run into several terabytes or rather petabytes. The moment you talk about these sizes for the data, the whole perspective of machine learning changes. In the traditional databases, the number of columns is quite low and thus the number of features for machine learning too is very small - generally goes in tens and at the most few hundreds, max. In NLP applications, as there are no columns like structured databases, each word in the text corpus becomes a probable candidate to be considered as a feature for model training. It is impossible to train a model with millions of features. So, to develop ML applications, the first and the major requirement is to reduce this features count by reducing the vocabulary. The other major requirement is to convert the text data into binary format as our dumb machine understand only binaries. That is where the NLP learning becomes distinct from model development on structured databases. Once the text data is pre-processed to get a minimal number of features that represent the entire text corpus, the rest of the model development process remains same as the traditional one - popularly known as Good Old Fashioned AI.
In this course, you will learn many text pre-processing techniques to make the huge text datasets ready for machine learning. You will learn many text-preprocessing techniques such as stemming, lemmatization, removing stop words, position-of-speech (POS) tagging, bag-of-words, and tf-idf.
You will then learn to apply the traditional statistics based algorithms for training the models. You will develop five industry standard real-life NLP applications. These applications would cover a wide span of NLP domain. You will learn binary and multi-class classifications. You will use both supervised and unsupervised learning. You will learn to use unsupervised clustering on text data. You will use LDA (LatentDirichletAllocation) algorithm for clustering. You will use support vector machines for classifying text.
On the business side, you will learn sentiment analysis, classifying research articles, ranking hotels based on customer reviews, news summarization, topic modeling and a quick start to Natural Language Understanding (NLU).
This course helps in getting a quick start on NLP and mastering several NLP techniques through a very practical approach. Each lesson has code to practice that makes your learning easy and quick.