spacy-pattern

05-10-2022 || 00:47
Tags: #spacy #nlp

spacy-pattern

Pattern can be a lot of things including LOWER, IS_DIGIT, IS_PUNCT, LEMMA, POS

Pattern list should be matched perfectly in order in the array.

pattern = [
   {"LEMMA": "love", "POS": "VERB"},
   {"POS": "NOUN"}
]

The above pattern can be matched with loved dogs, love cat but not just with love, cat.

Pattern can be more modifed using spacy-operator-quantifier


References