Exercise 04: Noun phrase chunking

Sometimes it's useful to use noun phrase chunking to extract key phrases…


In [ ]:
from textblob import TextBlob

sent = "That’s a great starting point for developing custom search, content recommenders, and even AI applications."
blob = TextBlob(sent)

repr(blob)

First let's look at the individual keywords:


In [ ]:
for w in blob.words:
  print(w)

Contrast those results with noun phrases:


In [ ]:
# noun pharses: that's, custom search, content recommenders, ai - Super helpful!
for np in blob.noun_phrases:
  print(np)

There's definitely more information in the key phrase custom search than there is in the individual keywords custom and search.