Natural Language Processing · Beginner level

Beginner level · Module 4 of 6 · 8 guided hours

Tokenization and Text Normalization

Splitting text into tokens and sentences with spaCy, and normalising tokens with lowercasing, stop-word removal and lemmatisation, including the special problems of spelling variation.

Learning objectives

  • Tokenise text into words and sentences with spaCy
  • Apply stop-word removal and lemmatisation
  • Explain how normalisation helps and harms, especially for spelling variation

Topics

  • what a token is
  • spaCy tokenisation
  • sentence segmentation
  • stop words
  • stemming and lemmatisation
  • spelling variation and normalisation dictionaries

Lessons

  1. Lesson 1 Tokenising Words and Sentences with spaCy

    Learners compare naive split() tokenisation with spaCy's rule-based tokeniser and sentence segmentation on real-looking messages.

    tokentokeniserspacy.blank('en') / en_core_web_smdoc.sentstoken attributes

  2. Lesson 2 Stop Words, Stemming and Lemmatisation

    Learners reduce vocabulary with stop-word removal and lemmatisation, and see when these steps help a classifier and when they remove meaning.

    stop wordsstemminglemmatisationtoken.lemma_vocabulary size

  3. Lesson 3 Normalising Spelling Variation

    How to handle informal spellings, abbreviations and mixed languages common in local messages, using normalisation dictionaries and careful, documented rules.

    spelling variationabbreviationscode-switchingnormalisation dictionaryorthography

Practical activity

Add tokenisation and normalisation to the level project pipeline (spaCy tokens, stop words with negations kept, lemmas and a normalisation dictionary) and record the vocabulary size at each step.

Expected outcomes

  • Working tokenisation and normalisation
  • Awareness of spelling variation and its risks

Assessment

Practical test on new messages (60%) and the normalisation dictionary with documentation (40%).

Free taster lesson Tokens, Stop Words and Spelling Variation Read a free self-study lesson on this topic in the Free Course Library.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.