Hello,
I've been using the Azure Form Recognizer service and created a few supervised learning models on https://fott-preview.azurewebsites.net/.
I'm currently at the stage where I want to use this model via Python in order to extract tabular and text data from PDFs into either a JSON or CSV. However, when I run the code in Python for the form recognizer
endpoint = "<my_endpoint>"
key = "<my_key>"
form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key))
model_id = "<my_model_id>"
form = r"<C:\path\to\my_form>"
with open(form, "rb") as rb_form:
poller = form_recognizer_client.begin_recognize_custom_forms(
model_id=model_id, form=rb_form, content_type="application/pdf"
)
This doesn't work and I get:
azure.core.exceptions.HttpResponseError: (1027) The Form Recognizer API version used to create the model and the current API version used for analyze are incompatible.
Here's what I've tried:
Specifying the
api_versionin thebegin_recognize_custom_formsmethod. I've tried both of them available2.1-preview.3and2.0and neither work so this means my model was trained in neither of these version despite it clearly saying the API version is 2.1 in the website above.Tried deleting all of the labels and reassigning them. This didn't change anything.
Refreshed the key. This didn't change anything.
Has anybody solved this problem or got any ideas? Thank you.