Is there a way to write a rule containing "OR" in the Matcher ? #12818
-
Hi, I would want to have the Matcher use LIKE_NUM or another custom attribute "._.is_cn". is_cn is simply a custom extension that I put on complicated text describing numbers likes 64x7 or 7/2. My pipeline recognize these complex representation of numbers. So to some extent I would like the Matcher to be able to use this pattern : I have not seen any way to do that... Currently the only I see to achieve my goal is either
Any better idea ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @lio-data, This is perhaps a naive suggestion, but when you're assigning things to be One other alternative that is maybe a little more involved, but would result in nicer matcher patterns is this: you can influence the definition of the |
Beta Was this translation helpful? Give feedback.
Hey @lio-data,
This is perhaps a naive suggestion, but when you're assigning things to be
._.is_cn
in your custom code, can't you also label all numbers as such, so that you don't need theLIKE_NUM
part anymore? For English, you can find its definition here.One other alternative that is maybe a little more involved, but would result in nicer matcher patterns is this: you can influence the definition of the
LIKE_NUM
attribute directly by going in and writing new language defaults and replacing thelex_attr_getters
with your own implementation. For more information on that, see here: https://spacy.io/usage/linguistic-features#language-data