Natural Language Processing (NLP) Using NLTK in Python
- 3 hours on-demand video
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Attain a strong foundation in Python for deep learning and NLP
- Build applications with Python, using the Natural Language Toolkit via NLP
- Get to grips on various NLP techniques to build an intelligent Chatbot
- Classify text and speech using the Naive Bayes Algorithm
- Use various tools and algorithms to build real-world applications
- Build solutions such as text similarity, summarization, sentiment analysis and anaphora resolution to get up to speed with new trends in NLP
- Write your own POS taggers and grammars so that any syntactic analyses can be performed easily
- Use the inbuilt chunker and create your own chunker to evaluate trained models
- Create your own named entities using dictionaries to use inbuilt text classification algorithms
Tokenizing text into sentences or words
Create a tokenize from NLTK
Process or tokenize your text
Now, we will explore the NLTK library by writing our own taggers. We’ll write various types of taggers such as Default tagger, Regular expression tagger and Lookup tagger.
Define a new Python function called learnDefaultTagger
Create an object of the DefaultTagger() class
Call the tag() function of the tagger object
Probabilistic CFG is a special type of CFG in which the sum of all the probabilities for the non-terminal tokens (left-hand side) should be equal to one. Let's write a simple example to understand more.
Identify tokens in the grammar
Join the list of all the production rules into a string
Recursive CFGs are a special types of CFG where the Tokens on the left-hand side are present on the right-hand side of a production rule. Palindromes are the best examples of recursive CFG.
Create a new list data structure called productions
Add production rules that define palindromes
Pass the newly constructed grammarString to the NLTK built-in nltk.CFG.fromstring function
Recursive descent parsers belong to the family of parsers that read the input from left to right and build the parse tree in a top-down fashion and traversing nodes in a pre-order fashion.
Define a new function, RDParserExample
Iterate over the list of sentences in the textlist variable
Create a new CFG object using grammar
Is it possible to print the list of all the words in the sentence that are nouns? Yes, for this, we will learn how to use a Python dictionary.
Define a new class called LearningDictionary
Create buildDictionary() and buildReverseDictionary()
A natural language that supports question marks (?), full stops (.), and exclamations (!) poses a challenge to us in identifying whether a statement has ended or it still continues after the punctuation characters. Let’s try and solve this classic problem.
Extract all the features from the traindata and store it in traindataset
In previous videos, we have written regular-expression-based POS taggers that leverage word suffixes, let’s try to write a program that leverages the feature extraction concept to find the POS of the words in the sentence.
Indicate the dual behavior of the words
Define a new function called withContextTagger()
Build a featuredata list
In many natural languages, while forming sentences, we avoid the repeated use of certain nouns with pronouns to simplify the sentence construction.
Define a new class called AnaphoraExample
Create a unique list of males and females
Create a NaiveBayesClassifier object called _classifier
In previous videos, we learned how to identify POS of the words, find named entities, and so on. Just like a word in English behaves as both a noun and a verb, finding the sense in which a word is used is very difficult for computer programs.
Define a function with the name understandWordSenseExamples()
Define a new function, understandBuiltinWSD()
Define a new variable called maps
Feedback is one of the most powerful measures for understanding relationships. In order to write computer programs that can measure and find the emotional quotient, we should have some good understanding of the ways these emotions are expressed in these natural languages.
Define a new function, wordBasedSentiment()
Define sample text to analyze
Conversational assistants or chatbots are not very new. One of the foremost of this kind is ELIZA, which was created in the early 1960s and is worth exploring. NLTK has a module, nltk.chat, which simplifies building these engines by providing a generic framework. Let’s see that in detail.
Create a new function called myEngine()
Define a nested tuple data structure
- Basic knowledge of NLP and some prior programming experience in Python is assumed. Familiarity with deep learning will be helpful.
Natural Language Processing (NLP) is the most interesting subfield of data science. It offers powerful ways to interpret and act on spoken and written language. It’s used to help deal with customer support enquiries, analyse how customers feel about a product, and provide intuitive user interfaces. If you wish to build high performing day-to-day apps by leveraging NLP, then go for this course.
This course teaches you to write applications using one of the popular data science concepts, NLP. You will begin with learning various concepts of natural language understanding, Natural Language Processing, and syntactic analysis. You will learn how to implement text classification, identify parts of speech, tag words, and more. You will also learn how to analyze sentence structures and master syntactic and semantic analysis. You will learn all of these through practical demonstrations, clear explanations, and interesting real-world examples. This course will give you a versatile range of NLP skills, which you will put to work in your own applications.
Contents and Overview
This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.
The first course, Natural Language Processing in Practice, will help you gain NLP skills by practical demonstrations, clear explanations, and interesting real-world examples. It will give you a versatile range of deep learning and NLP skills that you can put to work in your own applications.
The second course, Developing NLP Applications Using NLTK in Python, course is designed with advanced solutions that will take you from newbie to pro in performing natural language processing with NLTK. You will come across various concepts covering natural language understanding, natural language processing, and syntactic analysis. It consists of everything you need to efficiently use NLTK to implement text classification, identify parts of speech, tag words, and more. You will also learn how to analyze sentence structures and master syntactic and semantic analysis.
By the end of this course, you will be all ready to bring deep learning and NLP techniques to build intelligent systems using NLTK in Python.
Meet Your Expert(s):
We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth:
Smail Oubaalla is a talented Software Engineer with an interest in building the most effective, beautiful, and correct piece of software possible. He has helped companies build excellent programs. He also manages projects and has experience in designing and managing new ones. When not on the job, he loves hanging out with friends, hiking, and playing sports (football, basketball, rugby, and more). He also loves working his way through every recipe he can find in the family cookbook or elsewhere, and indulging his love for seeing new places.
Krishna Bhavsar has spent around 10 years working on natural language processing, social media analytics, and text mining in various industry domains such as hospitality, banking, healthcare, and more. He has worked on many different NLP libraries such as Stanford CoreNLP, IBM's SystemText and BigInsights, GATE, and NLTK to solve industry problems related to textual analysis. He has also worked on analyzing social media responses for popular television shows and popular retail brands and products. He has also published a paper on sentiment analysis augmentation techniques in 2010 NAACL. he recently created an NLP pipeline/toolset and open sourced it for public use. Apart from academics and technology, Krishna has a passion for motorcycles and football. In his free time, he likes to travel and explore. He has gone on pan-India road trips on his motorcycle and backpacking trips across most of the countries in South East Asia and Europe.
Naresh Kumar has more than a decade of professional experience in designing, implementing, and running very-large-scale Internet applications in Fortune Top 500 companies. He is a full-stack architect with hands-on experience in domains such as ecommerce, web hosting, healthcare, big data and analytics, data streaming, advertising, and databases. He believes in open source and contributes to it actively. Naresh keeps himself up-to-date with emerging technologies, from Linux systems internals to frontend technologies. He studied in BITS-Pilani, Rajasthan with dual degree in computer science and economics.
Pratap Dangeti develops machine learning and deep learning solutions for structured, image, and text data at TCS, in its research and innovation lab in Bangalore. He has acquired a lot of experience in both analytics and data science. He received his master's degree from IIT Bombay in its industrial engineering and operations research program. Pratap is an artificial intelligence enthusiast. When not working, he likes to read about nextgen technologies and innovative methodologies. He is also the author of the book Statistics for Machine Learning by Packt.
- This course is for data science professionals who would like to expand their knowledge from traditional NLP techniques to state-of-the-art techniques in the application of NLP.