senorkrabs / ai-ml-workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI/ML Workshop

Lab-1

Lab 2 - Amazon Transcribe + Comprehend

Using Amazon Transcribe Websocket in a static web application, we can capture voice, transcribe the voice stream into text, and then perform sentiment analysis on the text to display the POSITIVE, NEGATIVE, NUTURL sentiments.

Components built and deployed:

  • A static site with Amplify
  • real-time audio transcription via Amazon Transcribe over a WebSocket.
  • real-time comprehend API call to extract sentiments

This demo app uses browser microphone input and client-side JavaScript to demonstrate the real-time streaming audio transcription capability of Amazon Transcribe using WebSockets.

Check out the Amazon Transcribe WebSocket docs.

Building and Deploying

You have two options

Option 1 - Deploy to AWS as an Amplify app

amplifybutton

Option 2 - Run the app locally

Even though this is a static site consisting only of HTML, CSS, and client-side JavaScript, there is a build step required. Some of the modules used were originally made for server-side code and do not work natively in the browser.

We use browserify to enable browser support for the JavaScript modules we require().

  1. Clone the repo
  2. run npm install
  3. run npm run-script build to generate dist/main.js.

Once you've bundled the JavaScript, all you need is a webserver. For example, from your project directory:

npm install --global local-web-server
ws

Documents

The documentation in Docs directory can be built with

mkdocs build 

Credits

This project is based on code written by Karan Grover from the Amazon Transcribe team, who did the hard work (audio encoding, event stream marshalling). Sentiment fetch based on the transcription is added by Jianjun Xu

License

This library is licensed under the Apache 2.0 License.

About

License:Apache License 2.0


Languages

Language:Jupyter Notebook 94.4%Language:HTML 4.4%Language:JavaScript 1.0%Language:CSS 0.2%