DEV Community

Cover image for How to analyze chat sentiment using Amazon Lex and OpenAI-GPT-3 API: Deploy using Terraform and Github Actions
amlan
amlan

Posted on

How to analyze chat sentiment using Amazon Lex and OpenAI-GPT-3 API: Deploy using Terraform and Github Actions

ChatGPT is the most hot topic now in the tech community. Its growth in popularity in a short time has solidified its position among other similar solutions. I decided to have a go at learning the workings of the underlying API (not the exact ChatGPT API but the previous version of it). What best way to lean than use it in an usable use case.

The simplest use case I could think of using the AI to analyze the sentiment of a text. In this post I am using GPT-3 API to analyze the sentiment of a sentence. For an usable use case, the sentence is a chat typed on Amazon Lex, which can be a customer typing a feedback to an agent on the other side. Based on what the customer is typing on the chat via Lex, the GPT-3 API analyzes the sentiment and Lex responds according to the sentiment of the chat text. I am training a custom model using some sample data to tune the analysis based on my use case.

For demo video: https://youtube.com/shorts/HTtwq-QFeQ8

For more details on the post: https://amlanscloud.com/lexgptchat/

Top comments (1)

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers don’t have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.

If you choose to do so, you also have the option to add a canonical URL directly to your post.