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

Connected

Exercise

Creating training data (2)

Let's use the match patterns we've created in the previous exercise to bootstrap a set of training examples. The nlp object has already been created for you and the Matcher with the added patterns pattern1 and pattern2 is available as the variable matcher. A list of sentences is available as the variable TEXTS.

Instructions 1/2

undefined XP
    1
    2
  • Create a doc object for each text using nlp.pipe and find the matches in it.
  • Create a list of (start, end, label) tuples for the matches.