Chapter 1. Tokenizing Text and WordNet Basics

In this chapter, we will cover the following recipes:

  • Tokenizing text into sentences
  • Tokenizing sentences into words
  • Tokenizing sentences using regular expressions
  • Training a sentence tokenizer
  • Filtering stopwords in a tokenized sentence
  • Looking up Synsets for a word in WordNet
  • Looking up lemmas and synonyms in WordNet
  • Calculating WordNet Synset similarity
  • Discovering word collocations

Introduction

Natural Language ToolKit (NLTK) is a comprehensive Python library for natural language processing and text analytics. Originally designed for teaching, it has been adopted in the industry for research and development due to its usefulness and breadth of coverage. NLTK is often used for rapid prototyping of text processing ...

Get Python 3 Text Processing with NLTK 3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.