Athento allows you to define regular expressions or textual patterns to perform field extraction in the extraction templates. To configure a regular expression, you can access the field extraction settings in your template.
In the screenshot you can see a regular expression defined.
Using Artificial Intelligence (ChatGPT) to define regular expressions
In case you do not know how to define regular expressions, you can get assistance from artificial intelligence. In the same pop-up window where regular expressions are configured, you will see a section "AI Assistant".
By clicking, you can display the artificial intelligence assistant.
In this section there are two items to be filled in:
- Context: Optional. You can specify a context so that the AI has more information about the object of the regular expression you want to define. It is recommended to specify this context, in order to obtain a more precise regular expression. As an example, in the context you could write "I want a regular expression to extract a Spanish DNI number."
- Examples: Required. We must define between 3 and 10 examples of the text we are looking to extract with the regular expression. For example "7967579K" or "7967579-K".
Once these values are specified, after clicking on the "Suggest" button, ChatGPT will suggest a recommended regular expression and an explanation of it.
Once the answer is obtained, the regular expression can be copied using the button that appears in the upper right area next to the regular expression, and placed in the field extraction configuration itself.