In today’s digital age, customer reviews hold significant power in shaping buying decisions. For businesses striving to understand and improve customer experiences, harnessing the potential of AI becomes a game-changer. Sentiment Analysis is one area which can help businesses understand how customers perceive their products or services.
Based on this analysis, businesses can prioritize improvements, address issues, and make strategic decisions to enhance their offerings. Positive sentiments can be leveraged for marketing purposes, while negative sentiments can indicate areas needing improvement or damage control. At the same time, it helps users make an informed decision on which products they should buy.
There are many tools available today, that can help you build on this use case. However, the purpose of this blog is to showcase how this can be accomplished using No-Code tools and by leveraging SAP AI Core for Generative AI capabilities.
This ensures that citizen developers with no coding expertise or who can sometimes feel overwhelmed by the complexities of programming, are able to build applications within few hours.Also professional developers can quickly prototype with drag and drop ease and minimal configurations.
Today, I will take you through the process of creating a full stack application with SAP Build Apps and Generative AI that helps perform sentiment analysis on product reviews.
Let’s quickly dive into the details.
At its core, this app organizes products and their associated reviews, offering a comprehensive overview. It allows users to enter a product review and then categorizes it into positive, negative, or neutral review using Open AI’s ChatGPT to perform sentiment analysis.
The application consists of the following main parts:
Prerequisites
Click Set formula and enter the following formula:
GROUP(outputs["List records Reviews / Records listed"].records,item.productId,{productID:key,positive:COUNT(SELECT(items, item.sentiment == 3)), negative:COUNT(SELECT(items, item.sentiment == 1)), neutral: COUNT(SELECT(items, item.sentiment == 2))})
Please refer to this blog for more details on how to create Visual Cloud functions.
Add Integration for the Reviews backend.
Field | Binding |
Repeat with | The data variable Products1 |
Title label | Data item in repeat: current.ProductName |
positiveReviewCount | DEFAULT(FIND_BY_KEY(appVars.reviewCounts,”ProductID”, STRING(repeated.current.ProductID)).positive,0) |
negativeReviewcount | DEFAULT(FIND_BY_KEY(appVars.reviewCounts,”ProductID”, STRING(repeated.current.ProductID)).negative,0) |
neutralReviewcount | DEFAULT(FIND_BY_KEY(appVars.reviewCounts,”ProductID”, STRING(repeated.current.ProductID)).neutral,0) |
Image Source | You can choose any image of your choice |
Products UI should look like this –
newReviewSentiment | text | Store the sentiment of the review given. |
newReview | Text | Contains the text the user enters as a new review |
AIPayload | Object | Request Payload for the AI Core API |
Component Tap -> Set Page Variable -> Create Record -> Set Page Variable -> Create Record-> Navigate Back
Open the logic pane and create the logic flow for the Submit button.
Set Page Variable | Variable name – AIPayload Assigned Value – Object with Properties
|
Create Record | Resource – AICoreLLM Record – Page variable – AIPayload |
Set Page Variable | Variable Name – newReviewSentiment Assigned Value – Formula – outputs[“Save the AICore Response”].response.choices[0].message.content |
Create Record | Resource – Reviews Reviews – Object with properties Review – Page Variable – newReview ProductID – Page Parameter – ProductID sentiment – Formula – NUMBER(pageVars.newReviewSentiment) ReviewedBy – your name DateCreated – Formula – NOW() |
Voila! Your application is ready.
Watch the video to see how the application looks and works.
Awesome, we were able to build a full stack application leveraging Gen AI capabilities in very less time. That’s the power of No-Code and Generative AI.