spacy-pattern-builder
spacy-pattern-builder copied to clipboard
Fix depth not computed for second run.
Token depth is set to default None
by spacy when
set_extension
is called once.
We were computing depth only when attribute is not present. This causes an error when we try to pattern match with another sentence.
Fixed this by following few spacy best practices for extensions.