Modeling: Part 3 - High-Level ML Services Table of Content 1. Amazon Comprehend 1.1. Entities 1.2. Key Phrases 1.3. Language 1.4. Sentiment 1.5. Syntax 2. Amazon Translate 3. Amazon Transcribe 4. Amazon Polly 5. Amazon Rekognition 5.1. Rekognition: The Nitty Gritty 5.2. New in 2020: Rekognition Custom Labels 6. Amazon Forecast 6.1. More on Forecast algorithms 7. Amazon Lex 7.1. Amazon Lex Automated Chatbot Designer 8. Amazon Personalize 8.1. Amazon Personalize Features 8.2. Amazon Personalize Terminology 8.3. Amazon Personalize Hyperparameters 8.4. Maintaining Relevance 8.5. Amazon Personalize Security 8.6. Amazon Personalize Pricing 9. Other ML Services 9.1. Industrial Applications 10. TorchServe, AWS Neuron, AWS Panorama 10.1. AWS Panorama 11. Deep Composer, Fraud Detection, CodeGuru, Contact Lens 11.1. Amazon Fraud Detector 11.2. Amazon CodeGuru 11.3. Contact Lens for Amazon Connect 11.4. Amazon Kendra 12. Amazon Kendra, Amazon Augmented AI (A2I)
1. Amazon ComprehendNatural Language Processing and Text AnalyticsInput social media, emails, web pages, documents, transcripts, medical records (Comprehend Medical)Extract:Key phrases, Entities, Sentiment, Language, Syntax, Topics, Document classificationsCan train on your own data 1.1. Entities
1.2. Key Phrases
1.3. Language
1.4. Sentiment
1.5. Syntax
2. Amazon TranslateUses deep learning for translationSupports custom terminologyIn CSV or TMX formatAppropriate for proper names, brand names, etc.
3. Amazon TranscribeSpeech to textInput in FLAC, MP3, MP4, or WAV, in a specified languageStreaming audio supported (HTTP/2 or WebSocket)* French, English, Spanish onlySpeaker IdentificiationSpecify number of speakersChannel Identificationi.e., two callers could be transcribed separatelyMerging based on timing of “utterances”Automatic Language IdentificationYou don’t have to specify a language; it can detect the dominant one spoken.Custom VocabulariesVocabulary Lists (just a list of special words – names, acronyms)Vocabulary Tables (can include “SoundsLike”, “IPA”, and “DisplayAs”)
4. Amazon PollyNeural Text-To-Speech, many voices & languagesLexiconsCustomize pronunciation of specific words & phrasesExample: “World Wide Web Consortium” instead of “W3C”SSMLAlternative to plain textSpeech Synthesis Markup LanguageGives control over emphasis, pronunciation, breathing, whispering, speech rate, pitch, pauses.Speech MarksCan encode when sentence / word starts and ends in the audio streamUseful for lip-synching animation
5. Amazon RekognitionComputer visionObject and scene detectionCan use your own face collectionImage moderationFacial analysisCelebrity recognitionFace comparisonText in imageVideo analysisObjects / people / celebrities marked on timelinePeople Pathing
5.1. Rekognition: The Nitty GrittyImages come from S3, or provide image bytes as part of requestS3 will be faster if the image is already thereFacial recognition depends on good lighting, angle, visibility of eyes, resolutionVideo must come from Kinesis Video StreamsH.264 encoded5-30 FPSFavor resolution over framerateCan use with Lambda to trigger image analysis upon upload
5.2. New in 2020: Rekognition Custom LabelsTrain with a small set of labeled imagesUse your own labels for unique itemsExample: the NFL (National Football League in the US) uses custom labels to identify team logos, pylons, and foam fingers in images.
6. Amazon ForecastFully-managed service to deliver highly accurate forecasts with MLAutoML” chooses best model for your time series dataARIMA, DeepAR, ETS, NPTS, CNN-QR ProphetWorks with any time seriesPrice, promotions, economic performance, etc.Can combine with associated data to find relationshipsInventory planning, financial planning, resource planningBased on “dataset groups,” “predictors,” and “forecasts.”
6.1. More on Forecast algorithmsCNN-QRConvolutional Neural Network – Quantile RegressionBest for large datasets with hundreds of time seriesAccepts related historical time series data & metadataDeepAR+Recurrent Neural NetworkBest for large datasetsAccepts related forward-looking time series & metadataProphetAdditive model with non-linear trends and seasonalityNPTSNon-Parametric Time SeriesGood for sparse data. Has variants for seasonal / climatological forecastsARIMAAutoregressive Integrated Moving AverageCommonly used for simple datasets (<100 time series)ETSExponential SmoothingCommonly used for simple datasets (<100 time series)
7. Amazon LexBilled as the inner workings of AlexaNatural-language chatbot engineA Bot is built around IntentsUtterances invoke intents (“I want to order a pizza”)Lambda functions are invoked to fulfill the intentSlots specify extra information needed by the intent* Pizza size, toppings, crust type, when to deliver, etc.Can deploy to AWS Mobile SDK, Facebook Messenger, Slack, and Twilio 7.1. Amazon Lex Automated Chatbot DesignerYou provide existing conversation transcriptsLex applies NLP & deep learning, removing overlaps & ambiguityIntents, user requests, phrases, values for slots are extractedEnsures intents are well defined and separatedIntegrates with Amazon Connect transcripts
8. Amazon PersonalizeFully-managed recommender engineSame one Amazon usesAPI accessFeed in data (purchases, ratings, impressions, cart adds, catalog, user demographics etc.) via S3 or API integrationYou provide an explicit schema in Avro formatJavascript or SDKGetRecommendations* Recommended products, content, etc.* Similar itemsGetPersonalizedRanking* Rank a list of items provided* Allows editorial control / curationConsole and CLI too 8.1. Amazon Personalize FeaturesReal-time or batch recommendationsRecommendations for new users and new items (the cold start problem)Contextual recommendationsDevice type, time, etc.Similar itemsUnstructured text inputIntelligent user segmentationFor marketing campaigns
8.2. Amazon Personalize TerminologyDatasetsUsers, Items, InteractionsRecipesUSER_PERSONALIZATIONPERSONALIZED_RANKINGRELATED_ITEMSSolutionsTrains the modelOptimizes for relevance as well as your additional objectives* Video length, price, etc. – must be numericHyperparameter Optimization (HPO)CampaignsDeploys your “solution version”Deploys capacity for generating real-time recommendations
8.3. Amazon Personalize HyperparametersUser-Personalization, Personalized-Rankinghidden_dimension (HPO)bptt (back-propagation through time - RNN)recency_mask (weights recent events)min/max_user_history_length_percentile (filter out robots)exploration_weight 0-1, controls relevanceexploration_item_age_cut_off – how far back in time you goSimilar-itemsitem_id_hidden_dimension (HPO)item_metadata_hidden_dimension (HPO with min & max range specified) 8.4. Maintaining RelevanceKeep your datasets currentIncremental data importUse PutEvents operation to feed in real-time user behaviorRetrain the modelThey call this a new solution versionUpdates every 2 hours by defaultShould do a full retrain (trainingMode=FULL) weekly
8.5. Amazon Personalize SecurityData not shared across accountsData may be encrypted with KMSData may be encrypted at rest in your region (SSE-S3)Data in transit between your account and Amazon’s internal systems encrypted with TLS 1.2Access control via IAMData in S3 must have appropriate bucket policy for Amazon Personalize to process itMonitoring & logging via CloudWatch and CloudTrail 8.6. Amazon Personalize PricingData ingestion: per-GBTraining: per training-hourInference: per TPS-hourBatch recommendations: per user or per item
9. Other ML ServicesAmazon TextractOCR with forms, fields, tables supportAWS DeepRacerReinforcement learning powered 1/18scale race carDeepLensDeep learning-enabled video cameraIntegrated with Rekognition, SageMaker, Polly, Tensorflow, MXNet, Caffe 9.1. Industrial ApplicationsAmazon LookoutEquipment, metrics, visionDetects abnormalities from sensor data automatically to detect equipment issuesMonitors metrics from S3, RDS, Redshift, 3 rd party SaaS appsVision uses computer vision to detect defects in silicon wafers, circuit boards, etc.Amazon MonitronEnd to end system for monitoring industrial equipment & predictive maintenance
10. TorchServe, AWS Neuron, AWS PanoramaTorchServeModel serving framework for PyTorchPart of the PyTorch open source project from Facebook (Meta?)AWS NeuronSDK for ML inference specifically on AWS Inferentia chipsEC2 Inf1 instance typeIntegrated with SageMaker or whatever else you want (deep learning AMI’s, containers, Tensorflow, PyTorch, MXNet) 10.1. AWS PanoramaComputer Vision at the edgeBrings computer vision to your existing IP cameras
11. Deep Composer, Fraud Detection, CodeGuru, Contact LensAI-powered keyboardComposes a melody into an entire songFor educational purposes
11.1. Amazon Fraud DetectorUpload your own historical fraud dataBuilds custom models from a template you chooseExposes an API for your online applicationAssess risk from:New accountsGuest checkout“Try before you buy” abuseOnline payments 11.2. Amazon CodeGuruAutomated code reviews!Finds lines of code that hurt performanceResource leaks, race conditionsOffers specific recommendationsPowered by MLSupports Java and Python
11.3. Contact Lens for Amazon ConnectFor customer support call centersIngests audio data from recorded callsAllows search on calls / chatsSentiment analysisFind “utterances” that correlate with successful callsCategorize calls automaticallyMeasure talk speed and interruptionsTheme detection: discovers emerging issues 11.4. Amazon KendraEnterprise search with natural languageFor example, “Where is the IT support desk?” “How do I connect to my VPN?”Combines data from file systems, SharePoint, intranet, sharing services (JDBC, S3) into one searchable repositoryML-powered (of course) – uses thumbs up / down feedbackRelevance tuning – boost strength of document freshness, view counts, etc.Alexa’s sister? I don’t know, but that’s one way to remember it
12. Amazon Kendra, Amazon Augmented AI (A2I)Human review of ML predictionsBuilds workflows for reviewing low-confidence predictionsAccess the Mechanical Turk workforce or vendorsIntegrated into Amazon Textract and RekognitionIntegrates with SageMakerVery similar to Ground Truth