Event-Driven Architechure-Based AI Solution

Assessment, transcription of remote client`s verbal conversation, application of NLP for sentiment analysis and language translation

Input:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Algorithm:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Output:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Problem Definition

Electronic systems and processes are truly the vehicle by which communication centric businesses such as customer service, healthcare, rescue missions can broaden the accessibility of applications, facilitate user-provider exchange of information, and collapse time, distance, and the "information divide" to better deliver results.

Explore the application here ---> Serverless AI-Audio App

Serverless AI-Audio Solution v1

  • Record an audio file in English
  • Upload the audio/m4a file such as voicemail, short audio speech or other audio recordings.
  • Download the translated Spanish version of the uploaded file.

Inputs

Inputs: Audio file//speech in specified language, cloud formation template

Algorithm

Algorithm: The solution is an event based architecture complete without ec2instances. It involves the set of machine learning services and supporting cloud infrastructure, that puts machine learning into use. The solution uses a set of Artificial intelligence services from AWS AI services identified bellow.

  • Amazon Transcribe
  • Amazon Comprehend
  • Amazon Translate
  • Amazon Ploy
  • API Gateway
  • AWS Lambda
  • Amazon S3

AWS Lambda functions combined with S3 are used to tie all the services together in a serverless pipeline of AI services. A typical architecture diagram is shown in the UML communication diagram bellow which focuses on how strongly objects communicate with each other with the help of messages.

System Templates

Outputs

Output: Translated audio file/speech and text labelled with appropriate sentiments

Data Flow Diagram

The flow diagram consist of several AI services strung together to achieve automatic transcription and sentiment analysis. The cloudformation template contains the functions code base and configuration to attach several lambda functions to S3 buckets to achieve the near transparent event driven pipeline.

AWS API Gateway

The API gateway deployed a HTTP API . HTTP APIs are the best way to build APIs for a majority of use cases- They are up to 71% cheaper than REST API. With the AWS gateway API, the application can monitor performance metrics & informationon about API calls, data latency & error rates from the API Gateway dashboard which allows visual monitoring calls to services using Amazon cloud watch.

Event driven serverless architecture

The sequence of events flowing through the aws pipeline is highlighted below: Audio file is put into bucket. The bucket has been configured in such away to trigger the next lambda function along the flow, which would call transcribe and put it into the next bucket. When we place an object into that bucket, the second lambda function would trigger,and calltwo jobs :translate and comprehend. Output of both jobs will go into seperate buckets along the path. As far as Amazon comprehend is concerned, the sentiment analysisis called and a text file is produced containing the text and associated sentiment. The orther line involves putting the text in the next buckt that triggers the next lambda functionwhich will go ahead and call Poly. Poly will create an audio file in spanish (specified output language) i.e text to speech conversion encoded into an m4a file.

Code snippet

The components of the solution were built and glued together with the AWS management console. With this platform it is usually possible to discover and experiment with over 150 AWS services.  Cloud-based applications can be built in any AWS data center throughout the world. Users can be managed and monitored with access control configurations, service usage, health, and monthly billing. The API Gateway was built with the console and tested on the postman platform.

Other projects: