How to use OCR and NLP to dramatically simplify customer experiences
|Description||Extract text from photos using Pega NLP and Google Vision|
|Version as of||8.4 and later|
Pega NLP (natural language processing) along with the Google Vision OCR (optical character recognition) service can provide your service case with the artificial intelligence it requires to quickly understand an image shared or clicked by a customer, and easily derive the relevant data present within it. From a simple use case of obtaining device details present on a device, to complex use cases for getting the address details of a guest from a visiting card, all of these use cases not only make the end user's journey much easier, but also reduce the time the user spends on each journey.
- Enable Google’s cloud Vision API at console.developers.google.com and generate a new API Key to use in your application.
- Import the Google Vision OCR component from Pega Marketplace to your application. (See Get component)
- In your service case, invoke the D_GetTextFromOCR data page, then provide the Google API key and the image’s base64 string as input, to get ResponseData as output containing the raw text.
- Invoke a text analyzer rule to extract the entities from the raw text that the OCR engine provides. .pyText has the raw text extracted from the image, and places the output at .pyNLPOutcome
5. Define the entities and provide the extraction model to get the data present on the raw text. The extraction model can be based on a RUTA script or a machine learning model. You can use Prediction Studio to explore the options.
6. Once the text analyzer is executed in the context of a service case (@pxExecuteAnActivity(Primary,"pxRunTextAnalyzer")) extract the values that you require from the .pyNLPOutcome property.
The Guided internet service Microjourney in Pega Customer Service for Communications makes use of Pega’s artificial intelligence features, such as natural language processing and OCR, to help customers effortlessly enter their cable modem details during internet service setup.