BookmarkSubscribeRSS Feed

Hackathon Highlights: SAS AI delivers Sly Upsells for SASsy Treats

Started ‎02-03-2020 by
Modified ‎02-03-2020 by
Views 3,786

 

SASHackathonHighlights.jpgAs consumers, we encounter recommendation engines often without even noticing. Every time we use Netflix or Amazon, those engines spring into action. Your feedback on a Netflix show feeds the engine that suggests what else you may like because it can compare your choice to other people with similar preferences. Likewise, when you buy a product on Amazon, ribbons appear that say, “you may also like,” or, “customers who bought this also looked at."

 

Using SAS® software's text analytics capabilities in an internal AI hackathon, teammates @iconrado , @Xiasi@ssadgu and I – in one day – created a recommendation engine for a fictional candy company, SASsy Treats. Our application won first place.

 

Most of this article details what we did. Let's start by further illustrating how recommendation engines are used in the retail context. Consider the chart below with candy preferences that we can use to make some predictions:

 

 

Gummy Bears

Cookies

Dark Chocolate

You

?

Love

Hate

Me

Love

Love

?

Bob

Hate

?

Love

 

I don’t know if you like gummy bears, but I do know you like cookies. I like both cookies and gummy bears. Bob who likes dark chocolate doesn’t like gummy bears, and you don’t like dark chocolate.

 

Based on this information that shows similarities in our likes and dislikes, I would guess that you love gummy bears and you could also guess that I hate dark chocolate. Obviously, this test scenario does NOT have enough data to make such a bold claim, but this is essentially what those recommendation engines that make our lives easier are doing, just on a much larger scale.

 

SASsy Treats! - Personalizing Delivery Using Text Analytics and Artificial Intelligence

 

SaSsy treats logo .png

 

SASsy Treats was modeled after subscription box services that have risen in popular media in the past few years.  It focuses on delivering personalized monthly treat boxes to its customers.  To ensure that each delivery was personalized, we tasked ourselves with creating a recommendation engine that would mine past reviews left by the customer, score the reviews for sentiment, and factor the sentiment score into crafting the next, unique special treat box delivery. 

 

Our front-end is running on a simple Python Flask app, which we can integrate with SAS with the use of SWAT to perform real-time scoring.

 

Our Data

 

We used an Amazon review data set that is publicly available on Kaggle. This data set is great because it contains both a score rating, two main text document fields, and two classification fields, in addition to a few other factors.

 

 

sassy treats data.png

 

Sentiment Extraction Using SAS Visual Text Analytics

 

With SAS software’s text analytics models, we performed sentiment analysis, processing the words, discerning the overall intent of a review, and quantifying it as objectively as possible. The resulting data aided the engine in determining future customer preferences.

 

sasy treats pipeline.png

 

From the text analytics pipeline we extracted two models: a sentiment model and a topics model. These two models were used to score the review dataset. The scored data set was combined with the original dataset and used in building our recommendation engine.

 

Recommendation Engine Build

 

To build the recommendation engine, also called a factorization machine, we used the scored data from the text analytics pipeline to feed the machine data points, enabling it to create predictions from new data. Each prediction is unique based on past customer preferences and reviews. Below is a snippet of the SAS code used to build the factorization machine. 

 

/*Build the Factorization Machine*/
proc factmac data = casuser.review_model2;
     target Score;
     input Product_Id User_Id Tea Coffee Iced/ level=nominal;
     input Sentiment/level=interval;
     save state rstore=Public.factmac_astore (promote=yes);
     id_all;
run;

The text analytics and the factorization machine were the backbone to the website we created, allowing the consumer to get real-time personalized recommendations for their next ‘snack box.’

 

SAS® Viya Platform

 

We were able to provide SASsy Treats with an engine that operationalized analytics on their website, as well as a dashboard (shown below) using SAS® Visual Analytics that provided their analysts and decision makers with an overview of their top costumers and products. These tools allow SASsy Treats to get a better understanding of their customers and personalize their snack box recommendations.

 

sassy treats va.png

 

This is a prime example of SAS software's ability to produce real time, personalized results. The SAS Viya platform provided an easy to use framework to extract insights from the customer reviews and feed this to a recommendation engine, thus improving both customer experience and retention.

 

From No Experience to First Place – The Power of SAS 

 

In less than 12 hours, with no prior experience using text analytics or building a recommendation engine, our team of international associates built a fully functioning recommendation engine, placing first in the Artificial Intelligence Hackathon. That is the power of SAS technologies. SAS allowed us to be creative by mixing different forms of artificial intelligence technology to create a great tool for our fictional company, SASsy Treats, all accomplished with no in-depth, prior experience using these tools and technologies.

 

If you are interested in learning more, check out how a recommendation engine has been applied to the SAS Communities site that you are using right now!

 

Version history
Last update:
‎02-03-2020 12:37 PM
Updated by:

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags