Reader small image

You're reading from  Architecting AI Solutions on Salesforce

Product typeBook
Published inNov 2021
PublisherPackt
ISBN-139781801076012
Edition1st Edition
Concepts
Right arrow
Author (1)
Lars Malmqvist
Lars Malmqvist
author image
Lars Malmqvist

Lars Malmqvist is a 32x certified Salesforce CTA and has spent the past 15 years in the Salesforce ecosystem building advanced solutions on the platform. Currently, he works as a partner in the management consultancy, Implement Consulting Group, focusing on supporting large Nordic Salesforce clients in their transformation journeys. He has published two books, Architecting AI Solutions on Salesforce and Salesforce Anti-Patterns, both with Packt publishing.
Read more about Lars Malmqvist

Right arrow

Chapter 7: Building AI Features with Einstein Platform Services

This will be a hands-on chapter that will take you through three examples of using the Einstein Platform Services APIs to create custom AI solutions for the platform. Along the way, it will discuss some of the architectural choices and trade-offs involved. The examples will move from an image classifier to a text recognizer to a sentiment analysis application, all integrated into a normal Salesforce Sales or Service workflow.

In this chapter, we're going to cover the following main topics:

  • Introducing Einstein Platform Services
  • Getting started with the Vision and Language Model Builder
  • Classifying images with Einstein Vision
  • Understanding text with Einstein Language

After completing this chapter, you will have gained an understanding of how to use Einstein Platform Services to build AI solutions on Salesforce using advanced API-based methods.

Technical requirements

To follow along with the examples in this chapter, please register an analytics-enabled developer org. This can be requested using the form at https://developer.salesforce.com/promotions/orgs/analytics-de.

You will also need to download the chapter's code files that can be found here: https://github.com/PacktPublishing/Architecting-AI-Solutions-on-Salesforce/tree/main/Chapter07.

The Code in Action (CiA) video for the chapter can be found at https://bit.ly/3laT2ZK.

Introducing Einstein Platform Services

In this chapter, we will become familiar with Einstein Platform Services, the deep learning-driven APIs that Salesforce provides to deliver advanced AI-driven experiences on the Salesforce platform. With these services, you can not only leverage existing deep learning models, but you can also train or at least fine-tune custom models on your data to get cutting-edge performance for your particular use case.

Einstein Platform Services is, at its foundation, a set of RESTful APIs that are consumed on a usage-based pricing model that can be accessed to tap into deep learning capabilities delivered by Salesforce. It has two pillars: Einstein Vision, which focuses on computer vision use cases, and Einstein Language, which focuses on use cases for text processing. There is an additional app available called Einstein Vision and Language Model Builder that provides some UI niceness on top of the APIs, but this is an unsupported feature, so it can&apos...

Getting started with the Einstein Vision and Language Model Builder

Einstein Platform Services are, at their core, a set of RESTful APIs that can be accessed from any client that provides the appropriate credentials. However, while working in Salesforce, you have an option that slightly simplifies your life: the Einstein Vision and Language Model Builder.

This package started its life as a wrapper library on top of the REST services but is now a full-fledged exploratory UI and Apex library for working with Einstein Platform Services. It is available both as an AppExchange managed package, as shown in the following screenshot, and as an unmanaged package that you can deploy and customize based on your requirements:

Figure 7.1 – Einstein Vision and Language Model Builder AppExchange listing

The package, once installed as explained ahead, gives you the following three key capabilities to make your life easier:

  • Authentication is handled by the...

Classifying images with Einstein Vision

Einstein Vision is one of the two core pillars of Einstein Platform Services. In this section, we will briefly survey the elements that make up this offering and then move on to creating an image classifier while using our dataset for fine-tuning.

Overview of Einstein Vision

Einstein Vision is Salesforce's core offering in the computer vision space. It is less general-purpose than equivalent offerings from other vendors such as Google or Amazon and that is probably by design. Instead, it offers very deep functionality in areas that are core to CRM-type processes, including image classification, object detection, and OCR.

The three core APIs and their general capabilities are as follows:

  • Image classification: The image classification API allows you to classify images. There are a set of pre-built models that allow you to classify food images, general images, scene images, and multi-label images, all of which can help you...

Understanding text with Einstein Language

Einstein Language is the second pillar of Einstein Platform Services and focuses on APIs that allow you to extract structured information from unstructured text. From a research perspective, Salesforce is a leading player in publishing cutting-edge academic research on Natural Language Processing and Einstein Language is the way you, as a user of Salesforce, can tap into that. As for Einstein Vision, we will start by providing a quick overview of the APIs and then move on to the examples.

Overview of Einstein Language

If you were to summarize the Einstein Language APIs in a sentence, you'd say that they were all about understanding what a customer is trying to accomplish and how they might be feeling about it. As with Einstein Vision, this is a small subset of the total universe of Natural Language Processing (NLP) tasks that are available via various AI vendors beyond Salesforce, but it is a subset that is highly relevant to what...

Summary

In this chapter, we have looked at Einstein Platform Services, the APIs Salesforce provides to allow you to tap into their AI capabilities at a foundational level. We looked at three examples of how this technology can be used within the CRM, but to be honest, we've only been able to scratch the surface.

The APIs provide an impressive capacity to be tailored using customer-specific data and for customers to build their own set of models on top of the core technology provided by Salesforce. This is also the main reason to go in this direction, architecturally speaking. You should use Einstein Platform Services if you have a relatively advanced use case that requires a level of customized data to perform well and you have the necessary technical capacity to implement it.

One thing worth noting is that Einstein Platform Services is not an all-encompassing set of AI services in the style provided by Amazon, Microsoft, or Google. Rather, it is a focused niche offering...

Questions

  1. What feature might I use if I wanted to automatically detect whether my brand's products are on a shelf?
  2. Why might I want to train my own sentiment model rather than use the pre-built one?
  3. What is a limitation of Einstein OCR in comparison with other Einstein Platform Services?
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Architecting AI Solutions on Salesforce
Published in: Nov 2021Publisher: PacktISBN-13: 9781801076012
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Lars Malmqvist

Lars Malmqvist is a 32x certified Salesforce CTA and has spent the past 15 years in the Salesforce ecosystem building advanced solutions on the platform. Currently, he works as a partner in the management consultancy, Implement Consulting Group, focusing on supporting large Nordic Salesforce clients in their transformation journeys. He has published two books, Architecting AI Solutions on Salesforce and Salesforce Anti-Patterns, both with Packt publishing.
Read more about Lars Malmqvist