You need to sign in to do that
Don't have an account?
Narasimhan Chenduru
Predictive services, get status of the training
So, i have gone through the steps mentioned in the Metamind for developing the predictive services. In the step before the final step, we could go a GET request and fetch the status of the training model. My question is how long does this generally take to start the process. I have submitted the request and its been a couple of hours but still the training is in Queued.
Does this fall on the lines of asynchronous apex, where in it can take a maximum of 24 hours?
Thanks,
Narasimhan.
Does this fall on the lines of asynchronous apex, where in it can take a maximum of 24 hours?
Thanks,
Narasimhan.
This issue has been resolved. Training typically takes no more than 20-30 minutes depending on the size of the dataset and items in Queue.
We apologize for the delay and please let us know if you run into any other issues.
-MM
Hello,
I'm having an issue with trying to successfully train a model after I upload it.
I'm modeling my code after this: https://github.com/MetaMind/apex-utils/blob/master/Vision.apex
But the response that comes back is always a 403 : forbidden message.
Is there anything obvious causing this in my code?
@AuraEnabled
public static String postDatasetTrain(string datasetId, string datasetName) {
// Get a new token
JWT jwt = new JWT('RS256');
jwt.cert = 'SelfSignedCert_18Jul2016_235259';
jwt.iss = 'developer.force.com';
jwt.sub = 'joseph.daily@careerbuilder.com';
jwt.aud = 'https://api.metamind.io/v1/oauth2/token';
jwt.exp = '3600';
String access_token = JWTBearerFlow.getAccessToken('https://api.metamind.io/v1/oauth2/token', jwt);
String VISION_API = 'https://api.metamind.io/v1/vision';
String DATA_TRAIN = VISION_API + '/train';
string contentType = HttpFormBuilder.GetContentType();
// Compose the form
string form64 = '';
form64 += HttpFormBuilder.WriteBoundary();
form64 += HttpFormBuilder.WriteBodyParameter('name', datasetName);
form64 += HttpFormBuilder.WriteBoundary();
form64 += HttpFormBuilder.WriteBodyParameter('datasetId', datasetId);
form64 += HttpFormBuilder.WriteBoundary(HttpFormBuilder.EndingType.CrLf);
blob formBlob = EncodingUtil.base64Decode(form64);
string contentLength = string.valueOf(formBlob.size());
// Compose the http request
HttpRequest httpRequest = new HttpRequest();
httpRequest.setBodyAsBlob(formBlob);
httpRequest.setHeader('Connection', 'keep-alive');
httpRequest.setHeader('Content-Length', contentLength);
httpRequest.setHeader('Content-Type', contentType);
httpRequest.setMethod('POST');
httpRequest.setTimeout(120000);
httpRequest.setHeader('Authorization','Bearer ' + access_token);
httpRequest.setEndpoint(DATA_TRAIN);
Http http = new Http();
HTTPResponse res = http.send(httpRequest);
system.debug('res: ' + res);
system.debug('res.getBody(): ' + res.getBody());
return res.getBody();
}