@Khadija Alaqra Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
Yes, the SDK has the support for QueryFields
feature.
The following add-on capabilities are available for2024-02-29-preview
and later releases:
.
Please note that Query fields: query fields are reintroduced as a premium add-on feature. When the DocumentAnalysisFeature.QueryFields
argument is passed to a document analysis request, the service will further extract the values of the fields specified via the parameter queryFields
to supplement any existing fields defined by the model as fallback.
.
Suggestions:
You need to use one of the overloads of DocumentIntelligenceClient.AnalyzeDocumentAsync Method by passing the DocumentAnalysisFeature.QueryFields Property.
More info here: https://learn.microsoft.com/en-us/dotnet/api/azure.ai.documentintelligence.documentanalysisfeature.queryfields?view=azure-dotnet-preview
Sample code snippet here:
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(
WaitUntil.Completed,
"prebuilt-receipt",
new AnalyzeDocumentContent
{
Base64Source = new BinaryData(dbScanToWs.RelatedPDFs[i])
},
queryFields: new List<string> { "TaxDetails_TaxAmount", "TaxDetails_TaxNetPercentage" },
features: new List<DocumentAnalysisFeature> { DocumentAnalysisFeature.QueryFields });
AnalyzeResult receipts = operation.Value;
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.