Guide for Integrating Private AI DEID container with Azure OCR
This guide provides step-by-step instructions on setting up the Private AI container with the Azure OCR for processing images and documents. Both the cloud and containerized versions of Azure OCR are supported.
Our general recommendation is Azure Document Intelligence.
info
For Japanese documents, we recommend Azure Computer Vision for more accurate results.
Prerequisites
Access to Private AI's DEID container
See Grabbing the Image for more info on this.
Step 1: Create Azure OCR Service
Setup one of the following Azure OCR service to use with Private AI DEID Container: Please check out our Guide for OCR Modes Available with Private AI DEID Container to see the different modes of OCR supported by Private AI DEID Container.
Azure Document Intelligence Service
- Navigate to the Azure Portal.
- Create a new Azure Document Intelligence service by following the link: Create Document Intelligence
- Note down your Document Intelligence service endpoint and the key.
Or Azure Computer Vision Service
- Navigate to the Azure Portal.
- Create a new Azure Computer Vision service by following the link: Create Computer Vision
- Note down your service endpoint and the key.
Step 2: Start the container with Azure OCR service
Open a terminal and run the following command to start the container:
docker run --rm -v "/path/to/license/my-license-file.json":/app/license/license.json \
-e PAI_DISABLE_RAM_CHECK=True \
-e PAI_AZ_DOCUMENT_INTELLIGENCE_URL=https://<Your service>.cognitiveservices.azure.com/ \
-e PAI_AZ_DOCUMENT_INTELLIGENCE_KEY=<Your Key> \
-p 8080:8080 crprivateaiprod.azurecr.io/deid:<version>
The above command starts the container with Document Intelligence, for Computer Vision, please replace the above Document Intelligence environment variables with these.
PAI_AZ_COMPUTER_VISION_URL
PAI_AZ_COMPUTER_VISION_KEY
Step 3: (Alternative): Configure Docker Compose File to manipulate the containers including On-Premise Azure OCR container
Please see Private AI deid-examples repository - OCR Examples for more efficient container handling. Sample docker compose files are available including these topics.
- Option 1 - DEID Container with cloud Azure Computer Vision Service
- Option 2 - DEID Container with cloud Azure Document Intelligence Service
- Option 3 - DEID Container with On-Premise Azure Computer Vision Service
Step 4: Verify Operation
Once the containers are running, you can verify their operation by accessing the DEID service's exposed port (e.g., http://localhost:8080
) and performing a test OCR operation on your documents or images.