Using Twitter to Understand Pizza Delivery Apprehension During COVID
Analyzing customer sentiments and capturing any specific difference in emotion to order Dominos pizza in India during lockdown.
By Arimitra Maiti, Senior Analytics Consultant
Photo by Aarón Blanco Tejedor on Unsplash
Pizza makes anything possible.
CAUTION: This article, as well as the analysis findings, are not intended to sway any Domino’s customers. The truth underlying the observations are subject to further investigations by domain experts, and should not be interpreted as a form of slander. The data used in the study is neither personal data nor copyrighted data or something hidden behind a login.
India witnessed its first-ever nationwide lockdown from 24th March 2020 to 31st May 2020 to fight the spread of the novel coronavirus by limiting the movement of its residents. The study of this article aims at identifying the different emotions of customers in ordering pizza in India from one of the most popular pizza delivery chains called Dominos. From 128 stores in 2006 Domino’s India, the poster brand of Jubilant Foodworks reported more than 1300 stores in 2020 across the country. The study analyzed Twitter data during three different periods. The first period from 1st January 2020 to 24th March 2020 was considered as a pre-lockdown, the second period from 25th March 2020 to 31st May 2020 was considered as the lockdown period and finally, the third period from 1st January 2021 to 28th February 2021 was considered as post-lockdown. Twitter data for these three different periods were extracted using Sprinklr (licensed by IIM Ahmedabad), which is specialized in providing real-time user conversations from modern social handles. Sprinklr tool offers easy access to historical Twitter data generated by users across the globe.
The filters used in Sprinklr are “English only” language, source of data generation as “only Twitter”, and origin of data generation as “only India”. There were no explicit Twitter handles or Twitter hashtags used to extract the content across timelines, therefore it was assumed that the keyword “dominos” would represent the firm Dominos India serving pizza to customers from retail outlets or online platforms.
Figure-1 High-level approach of the analysis. (Image Source) : Image from author
The 1st column and upper half of the 2nd column are dependent on analyst efficiency and style. This approach does not proclaim to be the ideal one, because with the advent of newer concepts and techniques sentiment analysis has evolved by leaps and bound over the last 5 years. However, to remain close to the objective, the study found the above approach relevant. Further improvements and modifications are integral and hard to ignore. The basic problem definition is analyzing customer sentiments and capturing any specific difference in emotion across time periods. After cleaning and standardizing the user comments, each review passes through the methods assigned by texblob, sentiwordnet, and afinn which generates a score. If the score is less than zero then it is Negative, if the score is one then it is Neutral and if it is more than one then it is Positive.
The lower half of the 2nd column and the entire 3rd column can also be optimized further in future studies. The text2emotion method is used to extract an emotion for each review. As an add-on, this method separately gives a score along with the emotion category. The cumulative score simply tries to find out in the given dataset the accumulated score of a particular emotion category. The study wanted to validate which user reviews did not achieve a score from text2emotion.
Figure-2 Data Overview. (Image Source) : Image from author
Sentiwordnet is a popular module in the python nltk package which is used for opinion mining. This is based on WordNet dictionary and classifies a word as positive, neutral, or negative. Similarly, the AFINN lexicon is also a popular module from the “Afinn” package which is powerful for opinion mining. text2emotion is another useful tool in python that can be used to classify each sentiment as unique emotion. It is to be noted with caution that any of the dictionaries used by the analysts for scoring sentiments solely depends on the design of the dictionary. The final context of the language or user reaction may require further transformation to portray the business context which may not be understood by the dictionary. So the relevance of the output generated from any of the dictionaries used in the Natural Language Processing space is subject to the discretion of the study and cannot be taken at face value of the dictionary. A particular word may sound negative to the dictionary but in the real context, that same word may be neutral or positive.
Figure-3 Table showing what percentage of Twitter sentiment scores matched with Sentiwordnet or AFINN scores generated from the study. (Image Source) : Image from author
The table above suggests that for the collected data generated from Twitter, we may have relatively better results using the AFINN dictionary compared to Sentiwordnet or Text blob (currently not shown in the comparison).
Note: No prior splitting of train and test sets or cross-validations have been used to generate Sentiwordnet or AFINN scores. All user reactions across three timelines have been passed through each dictionary one by one.
Figure-4 Table showing the percentage of emotions captured across three timelines. (Image Source) : Image from author
According to our findings, fear as a text to emotion has risen dramatically from 6% during the pre-lockdown time to 15% during the lockdown period and 11% during the post-lockdown period. However, these fear-related feelings may not have developed as a result of dominos' pizza’s high-quality meals during and after the lockdown.
Let us look at few bigrams from three different timelines.
Figure-5 Bigrams from Pre-lockdown period only on Fear-related tweets. (Image Source) : Image from author
Figure-6 Bigrams from lockdown period only on Fear-related tweets. (Image Source) : Image from author
Figure-7 Bigrams from post-lockdown period only on Fear-related tweets. (Image Source) : Image from author
Bigrams only on Fear-related tweets across the three timelines imply a separate set of concepts. There were covid contraction cases reported by customers from the delivery partners like Swiggy and Zomato who were responsible for delivering the packages from retail outlets to customer destinations. In May 2020, Tata Consumer Products Ltd (TPCL) partnered with Dominos application for delivering their essential items. Hence the fear could be specific due to this particular service line where there could be a perceived uncertainty over sanitization instead of food quality.
The notebook can be accessed from here. The stoplist used for the study is shown below.
Code Snippet of processing and scoring the text. (Code Source) : Code from author
The goal of this research is to determine which emotions have changed significantly between the pre-covid and post-covid eras, notably in the Indian pizza market. It is not intended to diminish the value of any brand or to affect customer preference. The fact that fear of ordering pizza increased during the lockdown is empirical and directly relates to our post-covid mentality. It’s also worth noting that, other than “fear,” no other emotions have witnessed such big surges in pizza sales. It could imply that without the lockdown effect, pizza ordering feelings would continue to be mixed or cheerful, rather than entirely scared. For business managers strategizing dominos sales, the insights shared in this article may not be ground-breaking. On the other hand, the study tries to project a practical application of opinion mining that may be easily deduced from real-world experience.
Bio: Arimitra Maiti is an analytics professional with more than 10 years of experience in analytics consulting, statistical modeling, stakeholder management, and leading the development of analytics solutions that generate insight around cost and revenue optimization.
Original. Reposted with permission.
- What did COVID do to all our models?
- 6 NLP Techniques Every Data Scientist Should Know
- How to Create and Deploy a Simple Sentiment Analysis App via API
|Top Stories Past 30 Days|