1. 学习
  2. /
  3. 课程
  4. /
  5. Feature Engineering for NLP in Python

Connected

练习

Tokenizing the Gettysburg Address

In this exercise, you will be tokenizing one of the most famous speeches of all time: the Gettysburg Address delivered by American President Abraham Lincoln during the American Civil War.

The entire speech is available as a string named gettysburg.

说明

100 XP
  • Load the en_core_web_sm model using spacy.load().
  • Create a Doc object doc for the gettysburg string.
  • Using list comprehension, loop over doc to generate the token texts.