An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
@Vignesh Ramakrishnan You are most likely using a model created with the latest version of form recognizer API from the studio but the SDK client above is trying to pickup the model id from the previous versions so the error not found message is seen. Please see this thread for a similar discussion.
You will have to use the DocumentModelAdministrationClient to list the models and then use the same client to run the analyze method.
from azure.core.credentials import AzureKeyCredential
from azure.core.exceptions import ResourceNotFoundError
from azure.ai.formrecognizer import DocumentModelAdministrationClient, ModelBuildMode
endpoint = os.environ["AZURE_FORM_RECOGNIZER_ENDPOINT"]
key = os.environ["AZURE_FORM_RECOGNIZER_KEY"]
container_sas_url = os.environ["CONTAINER_SAS_URL"]
# [START get_resource_details]
document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))
account_info = document_model_admin_client.get_resource_details()
print("Our resource has {} custom models, and we can have at most {} custom models\n".format(
account_info.document_model_count, account_info.document_model_limit
))
# [END get_resource_details]
# Next, we get a paged list of all of our custom models
# [START list_models]
models = document_model_admin_client.list_models()
If an answer is helpful, please click on
or upvote
which might help other community members reading this thread.