Error in prodigy.models.matcher.parse_pattern_name

Hi,

I think there is a problem about using PatternMatcher.
I have a set of patterns, and some of them have 'XXXX-pattern' as their label.
For example, one of our patterns looks like {"pattern": [{"lower": "portrait"}], "label": "figure-pattern"}.

And as I observed, the function named parse_pattern_name() in prodigy.models.matcher uses the string 'pattern' as a delimiter to split a pattern's label and an integer.
For this reason, I cannot use the word 'pattern' in a pattern's label since the error "ValueError: invalid literal for int() with base 10: 'pattern--952826000' occurred.

Is there any workaround for this issue?

Thanks!

Hi! Looks like you hit an interesting edge case there, yes! We should probably use something more abstract here for the internal representations, just in case. Already updated this and will include the fix in the next release.

In the meantime, are you able to just use a different label name? Even changing it to uppercase should work fine.

Hi!

I will look forward to the fix. And yes, I already use another label name.

Thanks!

Just released v1.10.6, which includes a fix for this. The default delimiter is now ||, which shouldn't clash with user-defined labels :slightly_smiling_face: