1. 学习
  2. /
  3. 课程
  4. /
  5. Advanced NLP with spaCy

Connected

练习

Using the Matcher

Let's try spaCy's rule-based Matcher. You'll be using the example from the previous exercise and write a pattern that can match the phrase "iPhone X" in the text. The nlp object and a processed doc are already available.

说明 1 / 共 3 个

undefined XP
    1
    2
    3
  • Import the Matcher from spacy.matcher.
  • Initialize it with the nlp object's shared vocab.