Hi all,
I am trying to use the Form Recognizer connector with no luck.
I trained a few models, with the Cognitive Services API using my Cognitive Services instance. It works fine, I am able to query all my models to analyze new documents using my Model Id, with the API.
Now I want to use these models in Flow using the Analyze Document connector, but I can't access my model Id's.
With the Get Models connector, no models in the list. And obviously when I try Get Model, the Model Id is not found....
Any idea of what's going on?
Thanks!
Ben
Solved! Go to Solution.
Hi,
I have the same problem and so far, I think its an issue with the Form Recognizer action / connector.
I'll show with the "Get Keys" example, although I have tried with other actions:
I get the same error as you, but if I try to make the request directly through the API I get a valid response:
I've made sure that the connector to Form Recognizer is correctly configured to the same host used in the HTTP request above
Something like this:
Can you try making the request through the API to check if you (maybe) have the same issue as me or not?
In your case, your HTTP request (same as "Get Model") should be "https://{endpoint}/formrecognizer/v2.0-preview/custom/models/{modelId}"
(endpoint is https://{resource name}.cognitiveservices.azure.com)
Hi @BenTP,
Sorry, I can't test the Get models action cause account limitation.
But I can give some advice:
1. You can check the Model location whether correct.
2. Try to use the Train Model action by input the model ID to check whether it work.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I have the same problem and so far, I think its an issue with the Form Recognizer action / connector.
I'll show with the "Get Keys" example, although I have tried with other actions:
I get the same error as you, but if I try to make the request directly through the API I get a valid response:
I've made sure that the connector to Form Recognizer is correctly configured to the same host used in the HTTP request above
Something like this:
Can you try making the request through the API to check if you (maybe) have the same issue as me or not?
In your case, your HTTP request (same as "Get Model") should be "https://{endpoint}/formrecognizer/v2.0-preview/custom/models/{modelId}"
(endpoint is https://{resource name}.cognitiveservices.azure.com)
Hi @Anonymous ,
Thanks for your message, yes I was thinking using the http connector as well to make the API call rather than using the From Recognizer connector.
I'd tried what you suggested and it worked! I can query the model I built through the API.
I think I am going to go that way then.
And about this Form Recognizer connector, I am wondering if it doesn't work because I am on the free Tier for my cognitive services instance. Are you on free tier as well?
Cheers,
Ben
Were you ever able to input a file through your model and extract the tags through Flow? I am running into the same issues with trying to run my model on a file through flow. I was able to query the model through the HTTP call, but unsure exactly how to have it analyze a new file.
Sorry for the late response. I am also on the free tier for Cognitive Services. I think the problem with the connector is that it's not updated to use the most recent version of the API. Check the answer here by Neta: https://stackoverflow.com/questions/61504780/adding-azure-logic-app-step-for-form-recognizer-2-0-has...
@MikeD1
I actually got it to work. Might not be the best way but hey, if it works...
Just for reference, check this API documentation for the form recognizer. It was very helpful to me: https://westus2.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2/operations/AnalyzeW...
In short, what I did was:
First, call the API (in my case, the file was in an email attachement)
Then chek the "statusCode" of the response. I was looking for the "202" response, meaning that the request was accepted and it would be worked on. That same response will have the "Operation-Location" which is a call to "analyzeresults"
As said in the API docs, you can query the "Operation-Location" to track the progress, so that's what I did. I created a "Until" loop that kept sending another HTTP request (after a delay)
This loop was untill the response was either "succeded" or "failed"
In this same responde I had the results
After this I just parsed the results and I could work with them as I needed.
Hope this helps somehow
@Anonymous
Thanks for the help, this is helpful. I did read the documentation and I may be having an issue with syntax. If I set the "body" of the HTTP post as you I get an error:
Invalid request body. analyzeJsonRequest is not valid.
Here is my post:
When I run this code I get this:
-Which appears that the attachment content is empty. The "Get Attachment" operation does show content type. This might be getting off topic and I may need to post this on it's own. Thanks for the help though!
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!
User | Count |
---|---|
32 | |
32 | |
22 | |
22 | |
19 |
User | Count |
---|---|
56 | |
55 | |
41 | |
37 | |
29 |