In the recent past, using machine learning (ML) to make predictions, especially for data in the form of text and images, required extensive knowledge of ML to create and tune deep learning models. Today, ML has become more accessible to any user who wants to use ML models to generate business value. With Amazon SageMaker Canvas, you can create predictions for different types of data beyond tabular or time series data without writing a single line of code. These capabilities include pre-trained models for image, text, and document data types.
In this post, we discuss how you can use pre-trained models to recover predictions for supported data types beyond tabular data.
text data
SageMaker Canvas provides a code-free, visual environment for building, training, and deploying machine learning models. For natural language processing (NLP) tasks, SageMaker Canvas integrates seamlessly with Amazon Comprehend to allow you to perform key NLP capabilities such as language detection, entity recognition, sentiment analysis, topic modeling, and more. The integration eliminates the need for any coding or data engineering to use Amazon Comprehend’s robust NLP models. Simply provide your text data and select from four commonly used capabilities: sentiment analysis, language detection, entity extraction, and personal information detection. For each scenario, you can use the user interface to test and use batch prediction to select data stored in Amazon Simple Storage Service (Amazon S3).
Analysis of feelings
With sentiment analysis, SageMaker Canvas allows you to analyze the sentiment of your input text. You can determine whether the overall sentiment is positive, negative, mixed, or neutral, as shown in the screenshot below. This is useful in situations like analyzing product reviews. For example, the text “I love this product, it’s amazing!” SageMaker Canvas would classify this as a positive sentiment, while “This product is horrible, I regret buying it” would be labeled as a negative sentiment.
Entity extraction
SageMaker Canvas can analyze text and automatically detect entities mentioned in it. When a document is submitted to SageMaker Canvas for analysis, it will identify people, organizations, locations, dates, quantities, and other entities in the text. This entity extraction capability allows you to quickly obtain information about the people, places, and key details discussed in documents. For a list of supported entities, see Entities.
Language detection
SageMaker Canvas can also determine the dominant language of the text using Amazon Comprehend. Analyzes text to identify the primary language and provides confidence scores for the detected dominant language, but does not provide percentage breakdowns for multilingual documents. For best results with long documents in multiple languages, break the text into smaller pieces and aggregate the results to estimate language percentages. It works best with at least 20 characters of text.
Detection of personal information
You can also protect sensitive data by detecting personal information with SageMaker Canvas. It can scan text documents to automatically detect personally identifiable information (PII) entities, allowing you to locate sensitive data such as names, addresses, dates of birth, phone numbers, email addresses, and more. Scans documents up to 100KB and provides a confidence score for each detected entity so you can selectively review and redact the most sensitive information. For a list of detected entities, see PII Entity Detection.
Image data
SageMaker Canvas provides a code-free visual interface that makes it easy for you to use computer vision capabilities by integrating with Amazon Rekognition for image analysis. For example, you can load an image dataset, use Amazon Rekognition to detect objects and scenes, and perform text detection to address a wide range of use cases. Amazon Rekognition’s visual interface and integration make it possible for non-developers to take advantage of advanced computer vision techniques.
Object detection in images.
SageMaker Canvas uses Amazon Rekognition to detect tags (objects) in an image. You can upload the image from the SageMaker Canvas user interface or use the Batch prediction to select images stored in an S3 bucket. As shown in the example below, you can extract objects from the image, such as the clock tower, bus, buildings, and more. You can use the interface to search through the prediction results and sort them.
Text detection in images
Extracting text from images is a very common use case. Now you can easily perform this task in SageMaker Canvas without code. The text is extracted as line items, as shown in the following screenshot. The short phrases within the image are classified together and identified as one phrase.
You can perform batch predictions by uploading a set of images, extracting all images in a single batch job, and downloading the results as a CSV file. This solution is useful when you want to extract and detect text in images.
Document data
SageMaker Canvas offers a variety of out-of-the-box solutions that solve your everyday document understanding needs. These solutions are powered by Amazon Textract. To see all available document options, choose Ready-to-use models in the navigation panel and filter by Documentsas shown in the following screenshot.
Document analysis
Document analysis analyzes documents and forms for relationships between detected text. The operations return four categories of document extraction: plain text, forms, tables, and signatures. The solution’s ability to understand document structure gives you additional flexibility in the type of data you want to extract from documents. The following screenshot is an example of what table detection looks like.
This solution is capable of understanding complex document layouts, which is useful when you need to extract specific information from your documents.
Analysis of identity documents.
This solution is designed to analyze documents such as personal identification cards, driver’s licenses or other similar forms of identification. For each ID, information such as middle name, county, and birthplace will be returned, along with their individual confidence score on accuracy, as shown in the screenshot below.
There is an option to perform batch predictions, where you can upload ID document sets in bulk and process them as a batch job. This provides a quick and easy way to transform ID document details into key-value pairs that can be used for downstream processes such as data analysis.
Expense analysis
Expense analysis is designed to analyze expense documents such as invoices and receipts. The screenshot below is an example of what the extracted information looks like.
The results are returned as summary fields and line item fields. Summary fields are key-value pairs extracted from the document and contain keys such as Grand total, Due dateand Tax. Line item fields refer to data structured as a table in the document. This is useful for extracting information from the document while maintaining its layout.
Document queries
Document inquiries are designed so that you can ask questions about your documents. This is a great solution to use when you have multi-page documents and want to extract very specific answers from your documents. The following is an example of the types of questions you can ask and what the extracted answers look like.
The solution provides a simple interface so you can interact with your documents. This is useful when you want to get specific details in large documents.
Conclusion
SageMaker Canvas provides a no-code environment to easily use ML on various data types such as text, images, and documents. The visual interface and integration with AWS services such as Amazon Comprehend, Amazon Rekognition, and Amazon Textract eliminate the need for coding and data engineering. You can analyze text for sentiment, entities, languages, and PII. For images, object and text detection enables computer vision use cases. Finally, document analysis can extract text while preserving its layout for subsequent processes. Out-of-the-box solutions in SageMaker Canvas allow you to leverage advanced machine learning techniques to generate insights from structured and unstructured data. If you’re interested in using no-code tools with out-of-the-box machine learning models, try SageMaker Canvas today. For more information, see Getting started with Amazon SageMaker Canvas.
About the authors
Julia Ang is a solutions architect based in Singapore. He has worked with clients in a variety of fields, from healthcare and public sector to digitally native companies, to adopt solutions according to their business needs. He has also supported clients in Southeast Asia and beyond to use ai and ML in their businesses. Outside of work, he enjoys learning about the world by traveling and participating in creative activities.
Loke Jun Kai is a solutions architect specializing in ai/ML based in Singapore. He works with clients across ASEAN to build machine learning solutions at scale on AWS. Jun Kai is an advocate of Low-Code No-Code machine learning tools. In his free time he likes to be with nature.