in blazingtext-text-classification-train-in-sagemaker-deploy-with-lambda/container/app/app.py [0:0]
def handler(event, context):
print('Received event: ' + json.dumps(event, indent=2))
prediction = loaded_model.predict(event["text"])
print("Returning: {}".format(prediction))
return(json.dumps({"prediction": prediction[0][0]}))