Build intelligence in your eCommerce applications using Azure Open AI
Whenever I shop online, checking the reviews of the products is a tedious task. Sometimes the low-rated reviews are based on delivery, packaging... whereas a few high-rated reviews might be on cost but not on quality. Generally, reviews/ratings are displayed without any context which results in customers needing additional time and effort to get the most value out of it. Hence, we built this prototype using Azure Open AI to present the consolidated information from all the reviews of a product.
We fed all the reviews of a specific product to GPT-3 text-davinci-003 model with a prompt to classify the text based on the three categories – Cost, Quality, and Delivery. Prompt is where user provide the English text command which the API endpoint of the model will use to generate the completions.
Similarly, we classified the sentiment of the text using the same model on three categories - Positive, Neutral, and Negative.
Here is the sample result after the category classification and sentiment detection of the review text.
As you notice, we are using the pre-trained model available in Azure Open AI service as is above. There are three main approaches for in-context learning: Few-shot, one-shot and zero-shot. In this case, we didn’t provide any examples to the model and only the task request is provided hence it’s zero-shot learning. Based on your requirement or pilot testing, you shall consider fine tuning the model using one of the available models for fine tuning.
Above category classification and sentiment detection job needs execution only once per review text and store the results for future use. Existing data shall be analyzed using one of the batch processing design options and real time events shall be analyzed using one of the real-time processing design options in Azure Architecture Center.
Now when a user requests for review intelligence, make an API call to Azure Open AI service to summarize the reviews per category as shown in the following command.
Also consolidate the results from sentiment column per category to show the review intelligence summary below.
Another use case where Open AI service can bring value is on product search. First, get the embeddings of the product description text using get_embedding API with test-davinci-search-doc-001 model and store the result in a separate column named davinci_search.
Below is the sample data frame after including the embeddings.
Now using ordinary questions like text and using cosine similarity and text-search-davinci-query-001 model, we will retrieve the top four most relevant items as shown below.
The above search request will return the results like the one shown below.
Jupyter Notebook for this demo is available in this GitHub repo.
Below is an approach to extract data from your own knowledge base, create embeddings and use prompts to find the best answer to your customers.
Conclusion:
In this post we have seen a demo of how easy it is to use Azure Open AI service to bring intelligence to your eCommerce Portal and provide better experience to your customers.
Citation:
In this demo, we used the dataset published as part of the following paper.
Justifying recommendations using distantly-labeled reviews and fined-grained aspects
Jianmo Ni, Jiacheng Li, Julian McAuley
Empirical Methods in Natural Language Processing (EMNLP), 2019
Published on:
Learn moreRelated posts
This Month in Azure Static Web Apps | 09/2024
We are back with another edition of the Azure Static Web Apps Community! :party_popper: September was yet another month ...
GitHub Copilot for Azure: 6 Must-Try Features
As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...
Responsible AI Mitigation Layers
Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...
Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code
I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...
Build Intelligent Apps Code-First with Prompty and Azure AI
Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...
Certificación AI-900 (Fundamentos de IA) con Chicas en IA
La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...
Get certified with Learn Live GitHub series!
GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...
Certifícate con Learn Live GitHub en Español
Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...
Evaluating generative AI: Best practices for developers
As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...
Introducing Azure Product Retirement Livestreams
The Azure Retirements team, in collaboration with key partner groups, is excited t...