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 learning models deep. Today, ML has become more accessible to anyone who wants to use ML models to generate business value. With Amazon SageMaker Canvas, you can create predictions for a number of different data types, beyond tabular or time series data, without writing a single line of code. These features include pre-trained models for image, text, and document data types.
In this article, we explain how to use pre-trained models to retrieve predictions for supported data types beyond tabular data.
Text data
SageMaker Canvas provides a visual, no-code environment for building, training, and deploying ML models. For natural language processing (NLP) tasks, SageMaker Canvas integrates seamlessly with Amazon understands to enable you to run key NLP features like language detection, entity recognition, sentiment analysis, topic modeling, and more. The integration eliminates the need for coding or data engineering to use Amazon Comprehend’s robust NLP models. You simply provide your text data and choose from four commonly used features: 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 the data stored in Amazon Simple Storage Service (Amazon S3).
Sentiment Analysis
With sentiment analysis, SageMaker Canvas allows you to analyze the sentiment of your entered text. It can determine whether the overall sentiment is positive, negative, mixed, or neutral, as shown in the following screenshot. This is useful in situations such as analyzing product reviews. For example, the text “I love this product, it’s amazing!” ” would be classified by SageMaker Canvas as having a positive sentiment, whereas “This product is horrible, I regret buying it” would be classified as a negative sentiment.
Feature extraction
SageMaker Canvas can analyze text and automatically detect entities mentioned in it. When a document is sent to SageMaker Canvas for analysis, it identifies people, organizations, places, dates, quantities, and other entities in the text. This entity extraction feature 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 text using Amazon Comprehend. It analyzes the text to identify the primary language and provides confidence scores for the detected dominant language, but does not show a percentage breakdown for multilingual documents. For best results with long documents in multiple languages, break the text into smaller chunks and group the results to estimate language percentages. This works best with at least 20 characters of text.
Detection of personal information
You can also protect sensitive data with personal information detection 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, etc. It scans documents up to 100 KB 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 Detection of PII entities.
Image data
SageMaker Canvas provides a no-code visual interface that lets you easily use computer vision capabilities by integrating with Amazon Recognition for image analysis. For example, you can download an image dataset, use Amazon Rekognition to detect objects and scenes, and perform text detection to meet a wide range of use cases. Amazon Rekognition’s visual interface and integration allows non-developers to leverage advanced computer vision techniques.
Object detection in images
SageMaker Canvas uses Amazon Rekognition to detect labels (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 the following example shows, it can extract objects in the image such as a clock tower, a bus, buildings, etc. You can use the interface to search and sort prediction results.
Detecting text in images
Extracting text from images is a very common use case. Now you can complete this task easily on SageMaker Canvas without code. The text is extracted as line items, as shown in the following screenshot. The short sentences in the image are categorized together and identified as a sentence.
You can perform batch predictions by downloading a set of images, extracting all the 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 ready-to-use solutions that meet your everyday document understanding needs. These solutions are powered by Amazon Text. To view all options available for documents, choose to Ready-to-use templates in the navigation pane and filter by Documentsas shown in the following screenshot.
Document analysis
Document analysis analyzes documents and forms to determine relationships between detected texts. The operations return four document extraction categories: 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 able to understand the layout of complex documents, which is useful when you need to extract specific information in your documents.
Analysis of identity documents
This solution is designed to analyze documents such as personal ID cards, driving licenses or other similar forms of identification. Information such as middle name, county, and place of birth, as well as its individual confidence score for accuracy, will be returned for each ID, as shown in the following screenshot.
There is an option to perform batch prediction, where you can bulk upload sets of identification documents and process them in batches. This provides a fast and transparent way to transform details from identification documents into key-value pairs that can be used for downstream processes such as data analysis.
Spending analysis
Expense Analysis is designed to analyze expense documents such as invoices and receipts. The following screenshot 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 Total, Due dateAnd Tax. Line item fields refer to table-structured data in the document. This is useful for extracting information from the document while maintaining its layout.
Document requests
Document queries are designed to allow you to 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 to allow you to interact with your documents. This is useful when you want specific details in large documents.
Conclusion
SageMaker Canvas provides a no-code environment to easily use ML on different data types such as text, images, and documents. The visual interface and integration with AWS services like Amazon Comprehend, Amazon Rekognition, and Amazon Textract eliminate the need for coding and data engineering. You can analyze text to detect sentiments, entities, languages and personal information. For images, object and text detection enable computer vision use cases. Finally, document analysis can extract text while preserving its layout for downstream processes. SageMaker Canvas’s ready-to-use solutions allow you to leverage advanced ML techniques to generate insights from structured and unstructured data. If you want to use no-code tools with ready-to-use ML 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. She has worked with clients in diverse areas, from healthcare and public sector to digitally native enterprises, to adopt solutions based on their business needs. She has also helped clients in Southeast Asia and beyond use AI and ML in their businesses. Outside of work, she enjoys exploring the world through traveling and engaging in creative activities.
Loke Jun Kai is a specialist solutions architect for AI/ML based in Singapore. He works with ASEAN customers to build large-scale machine learning solutions in AWS. Jun Kai is an advocate for Low-Code No-Code machine learning tools. In his free time, he enjoys being in contact with nature.