Python Natural Language Processing Cookbook

Table of Contents

Chapter 1: Learning NLP basics

  1. Dividing text into sentences
  2. Dividing sentences into words: tokenization
  3. Part of speech tagging
  4. Stemming
  5. Combining similar words: lemmatization
  6. Removing stopwords

Chapter 2: Playing with grammar

  1. Counting nouns: plural and singular nouns
  2. Getting the dependency parse
  3. Splitting sentences into clauses
  4. Extracting noun chunks
  5. Extracting entities and relations
  6. Extracting subjects and objects of the sentence
  7. Finding references: anaphora resolution

Chapter 3: Representing text: capturing semantics

  1. Putting documents into a bag of words
  2. Constructing the N-gram model
  3. Representing texts with TF-IDF
  4. Using word embeddings
  5. Training your own embeddings model
  6. Representing phrases: phrase2vec
  7. Using BERT instead of word embeddings
  8. Getting started with semantic search

Chapter 4: Classifying texts

  1. Getting the dataset and evaluation ready
  2. Performing rule-based text classification using keywords
  3. Clustering sentences using K-Means: unsupervised text classification
  4. Using SVMs for supervised text classification
  5. Using LSTMs for supervised text classification

Chapter 5: Getting started with information extraction

  1. Using regular expressions
  2. Finding similar strings: Levenshtein distance
  3. Performing named entity recognition using spaCy
  4. Training your own NER model with spaCy
  5. Discovering sentiment analysis
  6. Sentiment for short texts using LSTM: Twitter
  7. Using BERT for sentiment analysis

Chapter 6: Building chatbots

  1. LDA topic modeling with sklearn
  2. LDA topic modeling with gensim
  3. NMF topic modeling
  4. K-Means topic modeling with BERT
  5. Topic modeling of short texts

Chapter 7: Topic modeling

  1. Building a basic chatbot with keyword matching
  2. Building a basic Rasa chatbot
  3. Creating question answer pairs with Rasa
  4. Creating and visualizing conversation paths with Rasa
  5. Creating actions for the Rasa chatbot

Chapter 8: Visualizing text data

  1. Visualizing the dependency parse
  2. Visualizing parts of speech
  3. Visualizing NER
  4. Constructing word clouds
  5. Visualizing topics