To perform an analysis—whether fraud, quality, or a classification—on the file of a document uploaded in Athento, there are two complementary operations:
op_resistant_analyze_document.py
op_resistant_check_document_analysis.py
It should be noted that this analysis is carried out through an integration with the Resistant AI application, so for it to work correctly, the RESISTANT_CLIENT_ID and RESISTANT_CLIENT_SECRET settings must be configured.
The first thing you must do is install both operations through the marketplace. Once this is done, you can configure the op_resistant_analyze_document operation to indicate the type of analysis to be performed. The options specified for this parameter indicate the way in which the analysis will be performed internally:
Once this configuration has been carried out, you will be able to proceed to run or automate the execution of these operations.
When running op_resistant_analyze_document on a document, you can see that its attributes indicate both the type of analysis that was sent to be performed, as well as an identifier of the analysis request generated by Resistant. This data is necessary to later obtain the analysis results.
After this, we will need to run the following operation op_resistant_check_document_analysis on that document. In this way we can obtain the analysis results. Depending on the type of analysis executed, one set of attributes or another will be created:
It is possible that at the time of executing this operation the results are not yet ready, since the analysis usually takes a few seconds. In that case, the same attribute will indicate that the results are not yet ready.