
Explore why natural language processing matters and survey key applications, from machine translation and speech-to-text to sentiment analysis and text generation, plus practical Python tools.
Explore practical uses of natural language processing, including machine translation, transcripts, caption generation for accessibility, and question answering, and examine theoretical questions about language, intelligence, and machine understanding.
The central message of this course is applying the same machine learning API to language data, focusing on text loading, processing, and interpretation with library-based tools.
Succeed in the course by using the Q&A, meeting prerequisites, and getting hands dirty with coding through exercises and handwritten notes.
Discover where to download the NLP in Python course code from the GitHub repository, using git clone or the download button, with clear folder structure and updates.
Learn the basics of classification, a supervised learning task that maps input data to categories. See how spam detection and handwritten digits illustrate this approach.
Explore regression in Python by building linear regression and a random forest regressor on the airfoil dataset, using a train-test split, and making predictions.
Explore how linear models, non-linear basics, ensemble methods, SVMs, and deep learning differ in interpretation, scalability, and use cases, with emphasis on experimentation over shortcuts.
Explore future topics in machine learning and deep learning, including supervised classification and regression, unsupervised clustering, reinforcement learning, hyperparameters, training versus test sets, and real-world applications.
Explore machine learning as a black box with inputs and outputs, using geometry for regression and classification. Master the workflow: load data, build, train, and evaluate models for email classification.
Describe the Markov property as the key assumption behind Markov models, illustrating sequence probability factorization with the chain rule and Bayes rule, and note its usefulness despite Box's quote.
Explore why maximum likelihood estimates can fail with unseen word pairs and apply smoothing techniques such as +1 and epsilon, and use log probabilities to assess sequence likelihoods.
Develop a two-class text classifier by building Markov models for Poe and Frost, map words to indices, use priors, and evaluate with accuracy and F1.
Build a text classifier using Markov models on line samples from Edgar Allan Poe and Robert Frost. Convert text to integers with tokenization and apply add one smoothing.
Build a second-order language model to generate Robert Frost poems. Create initial, first-order, and second-order dictionaries, tokenize text, and convert counts to probabilities.
Explore how Markov models power NLP by predicting the next value from past values, from first-order to higher-order, with Python implementations and applications in finance, reinforcement learning, and speech recognition.
Explore how to decrypt ciphers using probabilistic language models and genetic algorithms in Python, building encryption and decryption, dictionary creation, and maximum likelihood approaches from theory to code.
Explore the substitution cipher, where a one-to-one mapping encrypts and decrypts messages, illustrated with a concrete example of encoding and decoding.
Build a character-level language model with n-grams and a Markov assumption to score real versus unreal sentences. Use add-one smoothing, compute sequence probabilities, and decode by maximizing log-likelihood.
Encode a substitution cipher as a DNA string and mutate by swapping. Evaluate fitness with the log likelihood of the decrypted message and select the best.
Outline the pieces of a fully functioning message decryption script, including a random substitution cipher, a character-level language model, encoding and decoding functions, and a genetic algorithm.
Demonstrate creating a substitution cipher by building a true mapping from two letter lists, randomizing one side, and pairing letters with zip, to test a decryption algorithm in a simulation.
Develop a cipher decryption language model in Python using a 26 by 26 transition matrix and a 26-entry initial distribution. Learn add-one smoothing and log-probability calculations for words and sequences.
Download and preprocess the moby dick data, tokenize and lowercase text, update pi and transition counts for the language model, then normalize to probabilities; consider using log probabilities for efficiency.
Explore a genetic algorithm that evolves a dna pool of 20 shuffled strings to decrypt a cipher, scoring by log likelihood of decoded text and selecting top five across generations.
The lecture demonstrates a cipher decryption workflow in Python, using log likelihood to compare decoded and true messages, analyze wrong letters, and plot objective per iteration to illustrate convergence.
Explore cipher decryption using substitution ciphers, build a character-level language model with the Markov assumption and add one smoothing, and apply genetic algorithms to optimize results.
Learn to focus on text classification concepts rather than the underlying algorithms, as spam detection exercises show that any suitable classifier works, with Naive Bayes performing well for text features.
AdaBoost combines multiple weak classifiers into a strong ensemble by weighting misclassified samples and adding new decision stumps. Iteratively train stumps to improve accuracy by emphasizing current errors.
In addition to the word frequencies we looked at previously, this lecture looks at bag-of-words in general and different ways to implement that, including raw counts and binary indicator variables. We also briefly mention TF-IDF.
This lecture answers questions about how emails are converted into 48-word feature vectors and how to build a spam vs not-spam classifier in Python, emphasizing simple baselines for production.
Detect SMS spam by transforming text with tf-idf and count vectorizers, and compare Naive Bayes and boosting classifiers on the spam collection data.
Reclassify the sms spam dataset and build a text classification pipeline using count vectorization and train-test split, achieving about 98% accuracy; visualize spam and ham word clouds and analyze misclassifications.
Share feedback through a simple suggestion box form to tailor the course to your background, course, and difficulty. Highlight missing explanations or topics to shape future sessions and materials.
What is sentiment analysis? In this lecture we'll look at the data we'll be using to build our sentiment analysis tool, and talk about how we can manually pre-process the data so that we can plug it into a machine learning classifier.
Review logistic regression for NLP in Python, explain how a weighted feature vector defines a decision boundary, uses sigmoid probabilities, and shows how weight magnitude and sign influence sentiment predictions.
Define tokenization as splitting a string into tokens, typically words, using Python’s split or NLP tools, and customize when needed to remove stopwords, numbers, or single-letter tokens.
Turn tokens into a binary bag-of-words feature vector of size v using a word-to-index dictionary, then normalize by document length to obtain proportions for logistic regression.
In this lecture we'll write our sentiment analyzer in Python to predict sentiment on Amazon reviews.
Explore how to improve sentiment analysis in NLP with Python by examining data shuffling, baselines, benchmarks, and the role of interpretability.
How do we tag the tokens of a sentence by their parts-of-speech? i.e. Is this token a noun, verb, adjective, adverb, or something else?
How do we turn words into their "base form"? i.e. plural to singular
Can we also tag parts of a sentence as a "person", "organization", or "location"?
Explore why more NLP material isn't only about NLTK and learn to build your own feature vectors using machine learning models like naive Bayes and SVM with scikit-learn.
What is synonymy and polysemy and how can LSA / LSI help?
Explore the math behind latent semantic analysis with singular value decomposition, revealing latent factors and reducing redundancy through dimensionality reduction.
Apply latent semantic analysis in Python to preprocess book titles, build a term document matrix, and visualize clusters with a two-dimensional scatter plot.
Discover how latent semantic analysis uses unsupervised dimensionality reduction to reduce noise, visualize data, and power information retrieval with word vectors, clustering, and synonym discovery for search engines.
Extend latent semantic analysis on a term-document matrix by visualizing term and document vectors and comparing PCA, ICA, and non-linear methods like t-SNE, Isomap, and MDS.
What is article spinning and how is it related to search engines, SEO (search engine optimization), and Internet marketing?
What will be our strategy for creating an article spinner? We'll create a trigram model.
Demonstrates language modeling with engrams and trigram probabilities, showing how to condition on the previous two words (second-order Markov) to predict the next word and generate text.
Build a trigram language model from the reviews dataset to predict the middle word given two surrounding words, and implement a sampling function to draw words from a probability dictionary.
Create an article spinner in Python by building trigram probabilities from Amazon electronics reviews parsed with Beautiful Soup, then sample randomly to generate rewrites and assess limitations.
Extend your NLP word prediction project by widening context size, conditioning on past and future words, POS tags, and asymmetric windows, with dataset augmentation and latent word vectors.
Ever wondered how AI technologies like OpenAI ChatGPT, GPT-4, DALL-E, Midjourney, and Stable Diffusion really work? In this course, you will learn the foundations of these groundbreaking applications.
In this course you will build MULTIPLE practical systems using natural language processing, or NLP - the branch of machine learning and data science that deals with text and speech. This course is not part of my deep learning series, so it doesn't contain any hard math - just straight up coding in Python. All the materials for this course are FREE.
After a brief discussion about what NLP is and what it can do, we will begin building very useful stuff. The first thing we'll build is a cipher decryption algorithm. These have applications in warfare and espionage. We will learn how to build and apply several useful NLP tools in this section, namely, character-level language models (using the Markov principle), and genetic algorithms.
The second project, where we begin to use more traditional "machine learning", is to build a spam detector. You likely get very little spam these days, compared to say, the early 2000s, because of systems like these.
Next we'll build a model for sentiment analysis in Python. This is something that allows us to assign a score to a block of text that tells us how positive or negative it is. People have used sentiment analysis on Twitter to predict the stock market.
We'll go over some practical tools and techniques like the NLTK (natural language toolkit) library and latent semantic analysis or LSA.
Finally, we end the course by building an article spinner. This is a very hard problem and even the most popular products out there these days don't get it right. These lectures are designed to just get you started and to give you ideas for how you might improve on them yourself. Once mastered, you can use it as an SEO, or search engine optimization tool. Internet marketers everywhere will love you if you can do this for them!
This course focuses on "how to build and understand", not just "how to use". Anyone can learn to use an API in 15 minutes after reading some documentation. It's not about "remembering facts", it's about "seeing for yourself" via experimentation. It will teach you how to visualize what's happening in the model internally. If you want more than just a superficial look at machine learning models, this course is for you.
"If you can't implement it, you don't understand it"
Or as the great physicist Richard Feynman said: "What I cannot create, I do not understand".
My courses are the ONLY courses where you will learn how to implement machine learning algorithms from scratch
Other courses will teach you how to plug in your data into a library, but do you really need help with 3 lines of code?
After doing the same thing with 10 datasets, you realize you didn't learn 10 things. You learned 1 thing, and just repeated the same 3 lines of code 10 times...