Skip to content

Instantly share code, notes, and snippets.

@hozefam
Last active February 3, 2024 05:57
Show Gist options
  • Save hozefam/56a25283a892d60d8fb8ab920b011ccd to your computer and use it in GitHub Desktop.
Save hozefam/56a25283a892d60d8fb8ab920b011ccd to your computer and use it in GitHub Desktop.
AI Document Intelligence
using Azure;
using Azure.AI.FormRecognizer.DocumentAnalysis;
string endpoint = "<endpoint>";
string key = "<access-key>";
AzureKeyCredential cred = new AzureKeyCredential(key);
DocumentAnalysisClient client = new DocumentAnalysisClient(new Uri(endpoint), cred);
//sample form document
Uri fileUri = new Uri ("<url-of-document-to-analyze>");
AnalyzeDocumentOperation operation = await client.StartAnalyzeDocumentFromUriAsync("prebuilt-document", fileUri);
await operation.WaitForCompletionAsync();
AnalyzeResult result = operation.Value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment