How to bypass group reference in regex expression #1037
wanxingliu94
started this conversation in
General
Replies: 1 comment
-
Group references are incompatible with finite automata. I recommend subscribing to this issue. Once CFG is enabled in Outlines, you'll be able to define it as a Lark grammar which won't result in a massive automata. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a use case where I need to restrict the output format to be of the form A, B and A and B are different elements from a candidate set Candidates. This can be done by using group reference in regex expression. However, interregular does not support group reference https://github.com/MegaIng/interegular/blob/master/interegular/patterns.py#L557. Another approach I can take is to list all possible combinations of A, B in the regex expression directly, but my Candidates set can have a very large cardinality, say (> 1 million). That makes the regex string prohibitively long which might cause inference speed to decrease because of the complexity in parsing (the config file might not even be able to acconmodate that many characters)? Not exactly sure it that's an ideal approach or not.
Beta Was this translation helpful? Give feedback.
All reactions