[FormRecognizer] Parse operation IDs with regex
See original GitHub issueSummary
The implementation of the Operation constructors uses some magic numbers when parsing the operation ID.
Operations to address
-
CopyModelOperation
-
RecognizeContentOperation
-
RecognizeCustomFormsOperation
-
RecognizeReceiptsOperation
-
RecognizeIdDocumentsOperation
-
TrainingOperation
-
AnalyzeDocumentOperation
-
ClassifyDocumentOperation
Internal constructor
The internal
constructor takes a parameter called operationLocation
, which is returned from the service and is expected to look like:
{endpoint}/formrecognizer/{version}/custom/models/{modelId}/analyzeresults/{resultId}
Public constructor
The public
constructor, on the other hand, takes a parameter called operationId
, which is given by the developer and is expected to be a substring of the aforementioned operationLocation
:
{modelId}/analyzeresults/{resultId}
Goals
- Stop using magic numbers and correctly parse the arguments using regex, handling format errors.
- Make sure we support parsing model IDs with characters
_
,~
, and.
. These characters are allowed when naming a custom model. - Include new tests to verify proper behavior.
- Make sure existing tests still pass reliably.
The following file can be used as a reference: https://github.com/Azure/azure-sdk-for-net/blob/80a63242c93cbbff1ee525248cbd94d89ed72345/sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormField.cs#L90-L91
Related: #10385
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Document Intelligence (formerly Form Recognizer ...
As of July 2023, Form Recognizer is now Azure AI Document Intelligence! ... Model Compose operation, you can assign up to 200 models...
Read more >Regular expression to parse sequence IDs - python
I am trying to extract only IDs and sequences (skip all the metadata). Unfortunately, list operations alone don't suffice, e.g.
Read more >Getting Started with MS Azure Form Recognizer
The Form Recognizer service in Azure is an AI-based service that enables ... a document ID which can extracted using a regular expression....
Read more >Using regular expression
Use regular expressions (regex) to create string patterns that help match, locate, or manage text in Java. Together, the literals and ...
Read more >Parsing and extracting all IDs from a document (using ...
The idea was to capture all text between any occurrences of those two tokens, and do it non-greedily so that it doesn't capture...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By changing the parsing, the errors might change too, so we need to be careful here to not introduce breaking changes. Will wait first on the outcome of https://github.com/Azure/azure-sdk-for-net/issues/17383 before working on this to make sure we have the coverage
@maririos I wouldn’t say it’s a high-priority issue, since it just changes the behavior internally. @annelo-msft is keeping track of what issues we want closed for P3.