Parser ignores DEPs previously set by AttributeRuler #12337
-
My goal is to add some constraints to the tagger/parser so I have a mix of rule-based and model tagging/parsing. For example, suppose I want the word "foo" to always have TAG/DEP of DT/det. I added an attribute ruler before the tagger to set TAG/DEP for the word "foo". The attribute ruler works and the tagger uses the TAG set by the attribute ruler. The parser, however, ignores the DEP set by the attribute ruler. Is there a way to have the parser work like the tagger and keep any input DEP attributes?
I'm on Mac with Python 3.7 and Spacy 3.3.2. Edited to more clearly show the precise problem. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
No, there isn't. Some components can work around partial annotation to some degree (most of these have an Also be aware that that even though the tagger doesn't clobber existing annotation with |
Beta Was this translation helpful? Give feedback.
-
Thanks, this is very helpful! |
Beta Was this translation helpful? Give feedback.
No, there isn't. Some components can work around partial annotation to some degree (most of these have an
overwrite
setting so you can decide whether to preserve existing annotation), but the parser isn't one of them. It will always clobber all the existing annotation. The internal parsing algorithm just isn't intended to handle this case (in exchange it's very efficient).Also be aware that that even though the tagger doesn't clobber existing annotation with
overwrite=False
, it also doesn't use the existing annotation in any way to inform its predictions, so the existing annotation won't affect the tags of the surrounding words.