Step-by-step programming tutorials where you learn how to implement text classifiers in PHP.
In this course you will learn how to:
1- Extract features from text, continuous, and discrete features.
2- Build a feature extractor from text using PHP.
3- Build a Naive Bayes text classifier and apply it to Dialog Act classification.
4- Build a k-NN-based text classifier and apply it to text sentiment analysis.
You will also learn:
5- The source code in PHP for the classification systems that are taught in the course.
6- A trained model that could be used immediately for Dialog Act classification (very useful when building BOTs) and sentiment analysis.
What am I going to get from this course?
- Implement a text classifier using a programming language of your choice.
- Access the sourcecode and trained models for a Dialog Act classifier and Sentiment Analysis system (very useful for building BOTs and analyzing user comments)
Module 1: The Basics
This is an introduction that summarizes the content of the course
Discrete Word Features
The first step in classification is feature extraction. This video presents the extraction of discrete features from text.
Continuous Word Features
This videos presents Word Embeddings or Continuous features.
Text Classification using Naive Bayes
The principle of Naive Bayes classifiers is introduced
Naive Bayes Example
A simulation example of text classification using Naive Bayes and Discrete Features
Module 2: Dialog Act Classification
Preparing the data that will be used to train the Dialog Act Classifier.
Dialog Act Feature Extraction
Implement a discrete feature extractor adapted for Dialog Act classification.
Dialog Act Feature Extraction (Run the script)
Testing feature extraction on some examples.
Naive Bayes Classifier Training - 1
Implement the training function for a Naive Bayes Classifier.
Naive Bayes Classifier Training - 2
Test the Naive Bayes training function that was implemented in the previous Lecture.
Naive Bayes Classifier Testing
Implement the classification function.
Save then load a trained model on disk
As you saw in the previous lectures, we can train a Naive Bayes Model to do text classification.
a- Use the attached training data to train a Dialog Act Classifier.
b- Save the trained model on a file on disk.
c- Update the script so that you can load an already trained model to do classification instead of training a model each time.
Module 3: Sentiment Analysis
Sentiment Analysis Using Continuous Word Features
Use continuous word features associated with KNN classifier for sentiment analysis
Build a K-NN Based Sentiment Classifier - 1
Use word embeddings (continuous features) and K-NN to build a sentiment classifier of words.
A description of the training data that could be used for sentiment analysis.
Build a K-NN Based Sentiment Classifier - 2
Try the K-NN Sentiment Classifier that was built in the previous video.
Use the Dot Product to Build a Sentiment Classifier
Use the centroid of word embeddings and the dot product to build a classifier.
How to Improve the Sentiment Classifier
Some ideas on how one can make the sentiment classifier adaptable to sentences are presented in this video.