Artificial intelligence and machine learning offer truly game changing functionality, but you probably didn't need me to tell you that! Concepts like computer vision and natural language understanding help us to unlock additional value from data we already have in sources like pictures, videos, and text. Additionally, AI can help to convert and generate new media, for scenarios like language translation, text to speech audio synthesis, and transcribing audio to text.
Unfortunately, the process of learning the prerequisite theory, popular machine learning frameworks, and finally integrating this code into existing software, is cumbersome. Don't even get me started on the process of having to gather and clean your own datasets for training a model!
Using Amazon Rekognition to detect objects in an image
To help you on your journey, AWS has a multitude of services to help empower developers without previous machine learning expertise. In this post, I wanted to cover some of the fully managed AI APIs, which I find are the most actionable for developers looking to implement powerful AI functionality quickly. These services offer a cost-effective, highly accurate, easy to use solution, without having to manage more of the ML pipeline in a custom model solution with a tool like Amazon SageMaker. If you can use an SDK, you won't have to worry about any ML theory or ops here.
Some of the biggest benefits of AWS fully managed AI APIs over other self-rolled solutions:
Extremely high availability, with no need to manage scaling
Models are crafted and improved over time by AWS AI Applied Scientists. Integrate once, and the endpoints are automatically updated in waves when new versions of the models are launched
Predictable, value-aligned pricing model (pay per request)
Very easy to get started with - if you can use an SDK, you can use AWS AI APIs
The code samples were built using the minimal requirements wherever possible (I swear, most of the trickery is in the CSS), with the structure following a similar format to Translate.js, the most minimal example of the bunch:
// Translate.js // boilerplate react code above // 1. instantiate Translate clientvarTranslate=newAWS.Translate({apiVersion:'2017-07-01'});letcurrentComponent=this;// 2. call translateText methodif (!!TranslateParams.Text){Translate.translateText(TranslateParams,function (err,data){if (err){// 3a. catch errorcurrentComponent.setState({resultMessage:err.message});currentComponent.setState({resultTranslation:'No translation occurred - check the error!'})}else{// 3b. process successful responsecurrentComponent.setState({resultTranslation:data.TranslatedText});currentComponent.setState({resultMessage:"Text translation successful!"})}document.getElementById("chck1").checked=true;});};}render(){letresult,translation;// 4. If there is a result message from Translate, generate HTML from JSXif(this.state.resultMessage!==''){result=<code>{this.state.resultMessage}</code>
translation=<code>{this.state.resultTranslation}</code>
}/* other JSX code below for displaying info in app */
AWS AI Services - Fully managed AI services, on a pay-per-use model.
AWS Amplify - Development toolchain for building and deploying webapps
Another awesome callout here is Amplify Predictions, a class of functionality for the Amplify Framework that enables you to easily generate code that achieves similar functionality to what I created, all with a few simple CLI commands! I would highly recommend this, as the autogenerated code will save you significant time for some of the services that would otherwise require writing code to act as connective tissue (storing data to S3 before processing, for example).
Thanks for reading!
I hope this article and code sample were helpful for you! My goal with this was to offer a way to try AWS AI services for yourselves, with your own data. This way, you can see if these services would be a good fit for your use case - all before writing any of your own code. I'm working on some more demos in this space and would love to hear your thoughts!
For the latest updates on new demos, or to vote on the next one I'll create, follow along on twitter (@TheNickWalsh). Cheers!