Intermediate · module I8 · Sublevel Advanced
Natural Language Processing in Practice
By the end: Clean and represent text, build a text classifier and sentiment analyser, and build an intent-based chatbot
- Covers
- Processing text in Python, from tokens to sentiment analysis and chatbots
- Contents
- 3 chapters, 17 topics
- Time
- About 3 hours
- Level
- Intermediate
- Your progress
- 0 / 17
This module builds on Machine Learning Foundations. We suggest looking at it first, but the choice is yours.
Chapter 1 Text Processing
- 1.18 min Read Activity
Stages of NLP
Lexical, syntactic, semantic, discourse and pragmatic analysis
Interactive: trace a sentence through the stages
- 1.210 min Read Activity
Tokenisation and Text Cleaning
Splitting text, lowercasing, removing punctuation and stopwords
Code: clean product reviews
- 1.38 min Read Activity
- 1.410 min Read Activity
Parts of Speech and Named Entities
Tagging nouns, verbs, people, places and dates
Code: extract entities from news
Chapter 2 Representing Text
- 2.110 min Read Activity
- 2.210 min Read
TF-IDF
Weighting words that are frequent here but rare elsewhere
Code: find the keywords of a document
tf-idf = tf × log(N / df)
- 2.310 min Read Activity
N-gram Language Models
Predicting the next word from the previous ones, with probabilities and perplexity
Code: a bigram model of short sentences
P(wₙ given wₙ₋₁) = count(wₙ₋₁ wₙ) / count(wₙ₋₁)
- 2.410 min Read Activity
Word Embeddings
Words as vectors whose distance reflects meaning
Interactive: explore word neighbours
Chapter 3 NLP Applications
- 3.115 min Read Activity
Sentiment Analysis
Classifying text as positive, negative or neutral
Code: a review sentiment analyser
- 3.212 min Read Activity
- 3.310 min Read Activity
Topic Modelling
Discovering themes in a collection of documents
Code: find topics in short news items
- 3.412 min Read Activity
Machine Translation and Summarisation
From rule-based to neural translation, BLEU scores and extractive summaries
Code: score translations and summarise an article
- 3.515 min Read Activity
- 3.610 min Read Activity
- 3.710 min Read Activity
NLP for Indian Languages
Scripts, code-mixing and multilingual models
Code: translate and analyse Hinglish text
- 3.825 min Read Activity
Labelling Hinglish Reviews
Guidelines, sarcasm, negation, mixed opinions, independent annotation, Cohen's kappa and adjudication
Lab: label twenty reviews and revise a sentiment guideline
κ = (pₒ − pₑ) / (1 − pₑ)
- 3.915 min Read Activity