-
Sign up for an Einstein Platform Services Account. Follow this link to know more details – https://metamind.readme.io/docs/what-you-need-to-call-api#section-get-an-einstein-platform-services-account
-
Upload the Key obtained in step 1 into Salesforce Content. Follow this link to know more details – https://metamind.readme.io/docs/upload-your-key
-
Deploy Demo stuff to Salesforce (using bellow button or manually)
-
Create Remote Site Setting for Einstein APIs (read more here)
-
Populate Custom Settings
- Use EinsteinService class for getting sentiment of text. Example for Anonimous execution in Developer Console:
EinsteinService einstein = new EinsteinService();
SentimentAnalysisResponse response = einstein.findSentiment('I love Salesforce!');
System.debug('Response = '+ response);
In log we get next result:
Response = SentimentAnalysisResponse:[probabilities=(Probabilities:[label=positive, probability=0.49315557], Probabilities:[label=neutral, probability=0.3688144], Probabilities:[label=negative, probability=0.13803007])]
Copyright © Gleb Kosteiko