1. Learn
  2. /
  3. Courses
  4. /
  5. Advanced NLP with spaCy

Connected

Exercise

Debugging patterns (2)

Both patterns in this exercise contain mistakes and won't match as expected. Can you fix them?

The nlp and a doc have already been created for you. If you get stuck, try printing the tokens in the doc to see how the text will be split and adjust the pattern so that each dictionary represents one token.

Instructions

100 XP
  • Edit pattern1 so that it correctly matches all case-insensitive mentions of "Amazon" plus a title-cased proper noun.
  • Edit pattern2 so that it correctly matches all case-insensitive mentions of "ad-free", plus the following noun.