Skip to content

Commit

Permalink
update for minor testfix
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity committed Dec 17, 2024
1 parent d5391c9 commit 37364eb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ New features provided by the `azure-ai-documentintelligence` library include:
- `AUTO`: let the service determine where to split.
- `NONE`: the entire file is treated as a single document. No splitting is performed.
- `PER_PAGE`: each page is treated as a separate document. Each empty page is kept as its own document.
- **Batch analysis:** allows you to bulk process multiple documents using a single request.
Rather than having to submit documents individually, you can analyze a collection of documents like invoices, a series of a loan documents, or a group of custom documents simultaneously.

## Breaking Changes

Expand Down
16 changes: 16 additions & 0 deletions sdk/documentintelligence/azure-ai-documentintelligence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ It includes the following main features:
* Custom - Build custom models to extract text, field values, selection marks, and table data from documents. Custom models are built with your own data, so they're tailored to your documents.
* Read - Read information about textual elements, such as page words and lines in addition to text language information.
* Classifiers - Build custom classifiers to categorize documents into predefined classes.
- Batch analysis - Analyze multiple documents using a single request.

[Source code][source_code] | [Package (Maven)][package] | [API reference documentation][api_reference_doc] | [Product Documentation][product_documentation] | [Samples][sample_readme]

Expand Down Expand Up @@ -113,7 +114,20 @@ DocumentIntelligenceAsyncClient documentIntelligenceAsyncClient = new DocumentIn
.endpoint("{endpoint}")
.buildAsyncClient();
```
You will also need to [register a new Microsoft Entra application][register_aad_app] and grant access to Document Intelligence by assigning the `"Cognitive Services Data Reader"` role to your service principal.
It is strongly recommended to use Microsoft Entra ID as your default authentication approach. On the other hand, using an `AzureKeyCredential` can be helpful on getting-started scenarios since it can be set up fastly.

##### Get the API Key

The API key can be found in the [Azure Portal][azure_portal_get_endpoint] or by running the following Azure CLI command:

```PowerShell
az cognitiveservices account keys list --name "<resource-name>" --resource-group "<resource-group-name>"
```

```java com.azure.ai.documentanalysis.readme.DocumentIntelligenceAdministrationClient

```
## Key concepts
### DocumentAnalysisClient
The [DocumentAnalysisClient][document_analysis_sync_client] and [DocumentAnalysisAsyncClient][document_analysis_async_client]
Expand Down Expand Up @@ -477,6 +491,8 @@ For details on contributing to this repository, see the [contributing guide](htt
[analyze_identity_documents_from_url_async]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/documentintelligence/azure-ai-documentintelligence/src/samples/java/com/azure/ai/documentintelligence/AnalyzeIdentityDocumentsFromUrlAsync.java
[analyze_invoices_from_url]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/documentintelligence/azure-ai-documentintelligence/src/samples/java/com/azure/ai/documentintelligence/AnalyzeInvoicesFromUrl.java
[analyze_receipts_from_url]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/documentintelligence/azure-ai-documentintelligence/src/samples/java/com/azure/ai/documentintelligence/AnalyzeReceiptsFromUrl.java
[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
[azure_portal_get_endpoint]: https://learn.microsoft.com/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource#get-endpoint-url-and-keys

[fr_models]: https://aka.ms/azsdk/formrecognizer/models
[service_access]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ void validateIdentityData(AnalyzeResult analyzeResult) {
assertEquals("Main Street", licensePageFields.get("Address").getValueAddress().getStreetAddress());
assertNotNull(licensePageFields.get("Address").getConfidence());
assertEquals("USA", licensePageFields.get("CountryRegion").getValueCountryRegion());
assertNotNull(licensePageFields.get("CountryRegion").getConfidence());
assertEquals(LocalDate.of(1988, 3, 23), licensePageFields.get("DateOfBirth").getValueDate());
assertNotNull(licensePageFields.get("DateOfBirth").getConfidence());
assertEquals(LocalDate.of(2026, 3, 23), licensePageFields.get("DateOfExpiration").getValueDate());
Expand Down

0 comments on commit 37364eb

Please sign in to comment.