You need to sign in to do that
Don't have an account?
Michael Machado 22
Einstein Language Is now Beta - Feedback Forum
EINSTEIN LANGUAGE IS BETA!
We're excited to announce Einstein Language, a powerful set of new APIs that allow developers of all skill levels to integrate natural language processing into their applications. Developers can now leverage two new APIs, Einstein Sentiment and Einstein Intent, to unlock powerful insights within text.
EINSTEIN LANGUAGE
Build smarter apps with natural language processing.
• Einstein Sentiment (Beta) allows developers to classify the sentiment of text into positive, negative, and neutral classes.
• Einstein Intent (Beta) is a customizable natural language processing service that allows developers to categorize unstructured text into user defined labels to better understand and prioritize customers’ needs across channels.
• Einstein Language Technical Docs: https://metamind.readme.io/docs/intro-to-einstein-language
Please use this forum to provide feedback, success stories, and service questions.
-Einstein.ai Team
We're excited to announce Einstein Language, a powerful set of new APIs that allow developers of all skill levels to integrate natural language processing into their applications. Developers can now leverage two new APIs, Einstein Sentiment and Einstein Intent, to unlock powerful insights within text.
EINSTEIN LANGUAGE
Build smarter apps with natural language processing.
• Einstein Sentiment (Beta) allows developers to classify the sentiment of text into positive, negative, and neutral classes.
• Einstein Intent (Beta) is a customizable natural language processing service that allows developers to categorize unstructured text into user defined labels to better understand and prioritize customers’ needs across channels.
• Einstein Language Technical Docs: https://metamind.readme.io/docs/intro-to-einstein-language
Please use this forum to provide feedback, success stories, and service questions.
-Einstein.ai Team
POST from Salesforce -
POST from cURL -
-Michael
Thanks!
// Instantiate a new http object
Http h = new Http();
// Instantiate a new HTTP request
HttpRequest req = new HttpRequest();
//req.setEndpoint('https://api.einstein.ai/v2/language/intent?');
req.setMethod('POST');
// Send the request, and return a response
String contentBoundary = HttpFormBuilder.WriteBoundary();
String modelId = 'K6GSMOQKDQDJCMNL4FQF44OQSQ'; //insert your model Id
String sampleId= 'test';
String token = // Insert the token here
req.setEndpoint('https://api.einstein.ai/v2/language/intent');
String content = 'how is my package being shipped?';
String contentType = '';//'\nContent-Type: text/plain\nContent-Transfer-Encoding: gzip';
// assemble the body payload
String headerValue = '----' + contentBoundary + contentType+ '\nContent-Disposition: form-data; name="modelId";\n\n' + modelId + '\n';
String body = '----' + contentBoundary +contentType+ '\nContent-Disposition: form-data; name="document";\n\n' + content + '\n';
String bodySample = '----' + contentBoundary + '\nContent-Disposition: form-data; name="sampleId";\n\n' + 'Test' + '\n';
String footer ='----'+ contentBoundary + '--' ;
String bodyPayload = headerValue + body + footer;
String authorizationHeader = 'Bearer ' + token;
//EncodingUtil.base64Encode(headerValue);
req.setHeader('Content-Type', 'multipart/form-data; boundary=' + '--'+ contentBoundary);
req.setHeader('Authorization', authorizationHeader);
req.setHeader('Cache-Control', 'no-cache');
//if the request and response for your REST call is JSON, use the code below.
req.setHeader('accept', '*/*');
req.setHeader('Compressed', 'true');
// system.debug('the body of the request is '+bodyPayLoad);
//req.setHeader('Accept', '*/*');
req.setBody(bodyPayload);
system.debug('request is'+req.getBody());
HttpResponse res = h.send(req);
system.debug('the response is '+ res.getBody());