
Master natural language processing with machine learning by performing text classification, entity recognition, and sentiment analysis using logistic regression, Naive Bayes, and linear vector classifiers, with preprocessing and vectorization.
Define natural language processing as the relationship between computers and human language, tracing its evolution from rule-based and statistical methods to deep learning, enabling text classification and voice assistant applications.
Explore natural language processing with machine learning in Python, covering NLTK and spaCy basics, text vectorization, classification, sentiment analysis, and Twitter API integration.
Learn how to use Google Colab as the main tool to run Python code. Set the runtime to GPU or TPU and mount Google Drive for easy access.
Follow along by coding from scratch in Python on Google Colab, using notebooks and datasets provided with the lesson, and upload or copy resources to Google Drive as needed.
Explore tokenization in natural language processing with Python and NLTK, compare whitespace and treebank word tokenizers, and understand tokens as building blocks.
Learn token normalization to unify related word forms using stemming and lemmatization, turning walk, walked, and walking into a single base or lemma for better machine processing.
Explore stemming with the NLTK library by using Porter and Snowball stemmers on text tokenized with word tokenize method in Python, applying stems to each token in a for loop.
Lemmatize tokens with the WordNet lemmatizer in NLTK, compare noun and verb outputs, and download WordNet resources to enable accurate lemmatization.
Practice text analysis with NLTK by tokenizing the Stanford commencement speech into sentences and words in Python, leveraging stemming and lemmatization, counting them with len, and preparing data for pre-processing.
Use NLTK's regex tokenizer to remove punctuations and tokenize only words, then remove English stop words to reveal meaningful tokens and reduce counts.
Apply stemming with the Snowball stemmer and lemmatization with the WordNet lemmatizer to tokens. Compare how unique token counts change after stemming and lemmatization.
Explore how nltk pos_tag assigns parts of speech to tokens and influences lemmatization, with 'running' as noun vs verb, and why tagging should precede stop word removal.
Leverage pos tagging on the original token list, remove stop words, map tags to WordNet for lemmatization, and observe improved token normalization and reduced unique tokens.
Analyze the Bill Gates Harvard commencement address 2007 with NLTK, applying tokenization, normalization, stemming, lemmatization, and part-of-speech tagging to answer practical questions.
Get concise solutions to the NLTK exercise questions, and see how the answers may differ with different approaches and tool versions.
Explore spaCy, a powerful open source nlp library for developers, and compare it with nltk and CoreNLP, highlighting neural models, tokenization, pos tagging, and entity linking, with coreference resolution unavailable.
Learn how to use spaCy to tokenize text, create an NLP pipeline with spacy.load, and inspect token attributes like text, lemma, pos, and is_stop, using en_core_web_sm and the doc object.
Explore spaCy's entities and dependencies by inspecting doc.ents, using spaCy's explain function to interpret labels, and visualize syntax and named entities with displacy in a notebook.
Learn how spaCy builds a document via the nlp pipeline with independent components. Explore the tagger, parser, and entity recognizer, and note the tokenizer creates the doc outside the pipeline.
Learn how spaCy handles stopwords by adjusting nlp.defaults.stop_words and vocab.is_stop, removing or adding terms like 'six' or 'seven' to tailor stop-word behavior and lemmatized output.
Transform tokens into a numerical format that computers understand through text vectorization, starting with bag of words to build feature vectors from word counts, as shown with movie reviews.
Explore text vectorization with scikit-learn’s count vectorizer to build a bag of words, learn vocabulary, and create a term-document matrix, while examining word order limitations and normalization issues.
Explore n-grams to capture word order in a bag-of-words model, using one-grams and two-grams with count vectorizer, pandas, and a movie reviews example.
This lecture introduces TF-IDF, a powerful normalization that multiplies term frequency by inverse document frequency. It shows how TF-IDF highlights important words in document collections using movie and hotel reviews.
Apply tf-idf vectorization using the same notebook, initialize with 1-grams and 2-grams, fit, and view tf-idf values to understand this powerful nlp concept used in the industry.
Explore text classification from manual labeling to machine learning and deep learning, applying spam detection techniques and datasets in natural language processing with Python.
Learn how machine learning changes how we solve NLP problems by letting computers learn rules from data instead of hardcoding logic, with real-world sensor and text classification examples.
Explore the IMDb movie reviews dataset for natural language processing, a balanced 50,000-review corpus of 25,000 positive and 25,000 negative sentiments, loaded with pandas and prepared for train-test split.
Use scikit-learn's train_test_split to split data into training and testing sets with a 0.3 test size, revealing a 70/30 split for later text classification.
Explore text classification with logistic regression on binary data by vectorizing reviews with count vectorizer, training a scikit-learn model, and evaluating accuracy and a classification report.
Explore precision, recall, and f1 score in a classification report while identifying true positives, false positives, true negatives, and false negatives.
Fix the train-test split with a random state to ensure consistent data. Build pipelines that combine count or tf-idf vectorization with logistic regression, and explore n-grams.
Apply multinomial naive bayes and linear support vector classification to a text classification pipeline, compare results with logistic regression, and observe accuracies around 0.8875 and 0.92.
Explore sentiment analysis as a core NLP use case, measuring customer satisfaction and review subjectivity, compare text blob and VADER with models built from scratch using supervised learning.
Explore sentiment analysis with TextBlob, a Python library offering a simple API for polarity and subjectivity. Analyze sample texts and tweets to learn polarity from -1 to 1 and subjectivity.
Learn to use Vader for sentiment analysis by importing NLTK and Vader lexicon, instantiating sentiment intensity analyzer, interpreting compound, positive, neutral, and negative scores, and compare with TextBlob on Twitter.
Learn how to build a sentiment analysis model from scratch with logistic regression, using count-based features like positive and negative word frequencies to classify sentences.
Build a sentiment analysis model by loading balanced Twitter data and cleaning text with regex to remove hyperlinks, hashtags, and user tags, then lowercase for tokenization.
Explore tokenization of tweets, remove English stop words, and apply stemming to tokens, then prepare a reusable preprocessing function for batch tweet processing.
Create a single process tweet function to perform end-to-end tweet preprocessing, including tokenization, stopword removal, hashtags and user handles removal, line breaks, punctuation removal, lowercasing, and stemming.
Generate labeled tweet data with 5000 positive and 5000 negative examples, format as a 10000x1 label vector, combine the tweets, and split 70% training and 30% testing using train_test_split.
Create a frequencies dictionary of word counts by sentiment (positive or negative), updating via get and adding keys while iterating training tweets and labels, then prepare features for logistic regression.
Learn to prepare training and testing data for logistic regression by building a 7000 by 3 feature matrix of positive and negative token frequencies, using unique tokens to avoid overcounting.
Apply logistic regression for sentiment analysis using sklearn, train on X_train and Y_train, predict X_test, and evaluate with accuracy and classification report, feature engineering improves results vs VADER and TextBlob.
Learn Bayes rule and derive the naive Bayes algorithm for sentiment strength, and apply it to a balanced twitter dataset using conditional probabilities like P(word|positive) and P(positive|word).
Compute word frequencies and class-conditional probabilities for positive and negative classes, apply Laplace smoothing, then use log prior and log likelihood to sum lambda values for sentiment in Twitter data.
Apply sentiment analysis on a twitter dataset by importing Analytica, preparing positive and negative tweet sets, tokenizing, filtering stopwords, and creating train/test splits with labels for model training.
Build a frequencies dictionary for the vocabulary to store each word’s positive and negative counts and lambda, updating values from tokenized tweets via zip X_train and Y_train.
Calculate lambda as the log ratio of positive to negative probabilities for tokens, using positive and negative frequency counts, Laplace smoothing to avoid zeros, and update the frequencies dictionary accordingly.
visualize log likelihood across tweets by plotting the sum of positive and negative log likelihoods in a two-dimensional graph to show the separation of positive and negative tweets.
Compute sentiment predictions using log prior and log likelihood from token frequencies, evaluate accuracy on training and test data, and compare with logistic regression in a Python NLP workflow.
Register for the Twitter developer API to access Twitter data and gauge market sentiment, guiding you from applying in the developer portal to approval in a day or two.
Create a Twitter app in the developer portal, name it, and obtain the consumer key and secret and the access token and secret. Save these credentials to access the API.
Access the Twitter API from a notebook by supplying the consumer key and secret, plus the access key and secret, then fetch English tweets for sentiment analysis or text classification.
Conclude your natural language processing with machine learning in python course by applying fundamentals and advanced concepts to real projects, and explore Kagle dot com for problems to practice.
Welcome!
This course is carefully designed for you to learn the fundamentals of Natural Language Processing and then to advance gradually and to solve complex NLP problems using Machine Learning. Everything taught in this course is completely hands on. So you will be able to learn things by doing them yourself.
You don't need prior experience in Natural Language Processing, Machine Learning or even Python. But you should be comfortable with programming, and should be familiar with at least one programming language. Python is by far one of the best programming language to work on Machine Learning problems and it applies here as well. If you're new to Python, don't worry, I'll explain what you need to know, just before using it.
In this course, we use Google Colab to run our code. So, you don't have to install or configure anything in your machine. It doesn't matter what's your OS or hardware spec, as long as you have access to the Internet. But if you're interested, the same code can be run on Jupyter Notebook, installed in your machine.
First we will explore the basic concepts of Natural Language Processing, such as tokenization, stemming and lemmatization using NLTK. You will learn more than one way to get these things done, so you can understand the pros and cons of different approaches. Then we will study some pre-processing techniques for removing stop-words, whitespaces, punctuations, symbols, new lines, etc.
Next we will move to SpaCy - a state of the art NLP library heavily used in the industry. We will explore the NLP pipeline, and more advanced concepts such as Named Entity Recognition and Syntactic Dependencies. These techniques allow your code to automatically understand concepts like money, time, companies, products, locations, and many more simply by analysing the text information.
There we will cover Part-of-Speech tagging as well, where your code will be able to automatically assign words in text to their appropriate part of speech, such as nouns, verbs, adverbs and adjectives, an essential part of building intelligent language systems.
After that, you will learn how to transform text into a format where the computer can understand. This process is called vectorization. There're more than one way to do this, and you will learn the two most common mechanisms. Count vectorization and TF-IDF vectorization.
Next, we will move to Text Classification, where we will start using Machine Learning for Natural Language Processing. We will build a fully functioning model to classify IMDb movie reviews. There you will learn how to perform data cleansing, pre-processing, feature engineering, model training and testing. We will try out few different machine learning algorithms from the scikit-learn library, such as Logistic Regression, Naive Bayes and Linear SVC, and we will explore how to improve the performance on each case. You will be able to use the learnings from this section to address real world NLP problems, such as review classifications or spam detection.
Then we will move to one of the most demanding areas of Natural Language Processing, which is Sentiment Analysis. First we will explore how to use some built-in sentiment analysis tools such as TextBlob and VADER. Then we will start building our own Sentiment Analyzer using Logistic Regression and Naive Bayes. There we will go through all the steps required to build a sentiment analyser from the scratch, including pre-processing, feature engineering, training and testing.
Finally we will complete this course by learning how to integrate Twitter's APIs to pull Twitter data. Twitter is by far the strongest social media when it comes to text data. Some investors, banks and hedge funds are already using Twitter data to understand the market sentiment. So why not learn how to use this valuable resource, as the data source for your NLP problem.
Natural Language Processing is becoming one of the highly demanding skillset in the technology industry, and this course will help you to start your NLP journey.
What are you waiting for? Start your journey to become an expert in NLP today!
All of this comes with a 30 day money back garuantee, so you can try the course risk free.
I will see you inside the course.