Active learning of RegEx with existing samples #53
-
Hi! Suppose I want to learn the following regex The string "infinity" is fairly long and hard to bruteforce. I know that it's accepted by the regex I want to learn though, and I would like to pass this information to the regex learner. I've tried to pass it via the
I'd appreciate your suggestions very much. On a side note, is there a recommended way to convert the learned DFA to a RegEx? Currently I am using the Python Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You could create a custom oracle that checks whether the model conforms to your domain knowledge in addition to using some other strategy. The code below should do the trick.
As for the conversion between DFAs and RegEx: I'm afraid I can't help you with this one since I'm not really a DFA person... |
Beta Was this translation helpful? Give feedback.
-
Hi, another alternative is to use You just wrap one oracle and this counterexample in this one, and pass it to the learning algorithm.
|
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for your quick replies! I am now using ProvidedSequencesOracleWrapper as @emuskardin suggested, and it works. I have a follow-up question. Suppose I want to learn the regex Thanks! |
Beta Was this translation helpful? Give feedback.
Hi,
another alternative is to use
ProvidedSequencesOracleWrapper
:https://github.com/DES-Lab/AALpy/blob/master/aalpy/oracles/ProvidedSequencesOracleWrapper.py
You just wrap one oracle and this counterexample in this one, and pass it to the learning algorithm.
samples
parameter adds samples to the cache, therefore making learning more efficient, but those are not included in the EqOracle.