**1. Introduction**

The World Wide Web (WWW) has revolutionized our lives with many different services to facilitate its users such as online shopping, online study courses, online banking and many more. For the last decade, e-commerce (the act of buying and selling of products through internet) is growing day by day and has emerged into the future of shopping. The trend setters in modern e-commerce are Amazon, E-Bay, Ali Baba Express, olx, Daraz.com, and many others. One of the largest retailing e-commerce website is AMAZON.com. Recently, there are approximately 244 million Active buyer accounts, 200 million active products on Amazon and 2.2 billion sales in the past 12 months (average 6 million sales a day [1]. Shopping by e-commerce creates much ease for the customers and businesses as well. However, a challenge faced by the e-commerce users is the need for a better and improved platform to compare and select products and its prices for best choice selection [2]. If such a platform is available, it can save a customer's time, money and energy and can help in buying better products that fulfill their requirements. A big source of knowledge is customers' reviews and feedbacks of a product at social media and e-commerce websites that can effectively guide new customers about previous customers' opinions, interests, past experience and brand loyalty [3–7]. Such information can be very helpful for new customers to buy online with satisfaction and select a right product.

To know about a customer's loyalty to a product, the easiest and widely used technique for measuring customer satisfaction is to understand their sentiments or opinions, which they expressed

in the form of comments [8–10]. The most important way to understand their feelings, mood and sentiments or what they are trying to say is to judge their reviews and comments about the product and services [11]. After collecting the information about the consumer's opinion, we can distinguish what is necessary and what is not. The tracking of opinions, feeling, responses and mood of the customers is known as opinion mining and sentiment analysis [12]. The recent type of text analysis that targets to conclude the opinion and polarity of reviews is referred to as Sentiment Analysis. It is a kind of text analysis that deals with a wide aspect of natural language processing, computational semantics and text mining [13].

The current web is a huge repository of valuable information in the scattered form such as micro-blogging websites, such as Twitter or Facebook, have billions of comments and opinions uploaded on daily basis. Sentiments, such as opinions, attitudes, views and emotions, are personal experiences of individuals that are not open to impartial observation. They are stated in language that uses subjective opinions which express sentiment analysis. Most of the organizations carried opinion mining and sentiment analysis of the reviews of online posts [14–17]. The opinions expressed on social networking sites are very effective for the decision making process of business organizations. Organizations use these posts to extract the opinions of the people and to perform sentiment analysis. Sentiment analysis provides a part of text to be positive, neutral or negative in sense.

Previously, general purpose sentiment analysis of tweets and posts have been carried out [3–12], however a task-oriented sentiment analysis of users' reviews of a product to find key features liked by the users and measuring their confidence level is a new idea. A challenge in performing a task-oriented sentiment analysis is measuring a customer's loyalty to a specific product on the basis of customers' views about a product. In this paper, we propose a novel idea of using sentiment score of each customer review of a product and then take the aggerate of the sentiment score and then use such a score to measure customers' loyalty with a product. In this paper, a fuzzy logic method is used for measuring customers' loyalty to a product with the help of sentiment analysis score as shown in Figure 1.

**Figure 1.** A sketch of proposed approach for Customer Loyalty Measurement.

In our approach, we identify sentiments of users by reading their comments of social network users and by analyzing this we can view them as positive, neutral or negative. We measure the "PN-polarity" of subjective terms, i.e., recognizes whether a text can be positive or negative in which opinions and emotions are expressed. Stanford core NLP is a set of tools and techniques that provides sense to the computer to understand the speech of a human. Stanford Core NLP is transcribed in Java and requires Java 1.8+. Java is required to be connected to execute Core NLP. However, other languages for code writing, e.g., Python or JS (Java Script), can be used and some other languages [18]. With the help of Core NLP, our approach easily understands what people are trying to express through their words. To retrieve sentiments and polarity of input text apply, SentiWordNet library [19] is used to measure the customer involvement level towards a product. Here, we apply the sentiment analysis on the products reviews and also performs P-N polarity on this set of data that tells the positivity, neutral and negativity of reviews and tries to provides accurate results.

Finally, to measure customers' loyalty on the basis of sentiment score calculated from the reviews, the fuzzy logic method is applied. Fuzzy Logic is a process of reasoning that looks a lot like human reasoning [20]. This approach replicates the way of decision making in a human being that includes all the possibilities between digital values YES and NO. The standard logic that a computer can easily understand is to takes specific input and produces a certain output as TRUE or FALSE, or1 or 0, which is equal to the human YES or NO. The fuzzy logic works on the levels of possibilities of input to achieve the definite output and is also called many valued logic which only deals with the truth values [4]. It is also known as many valued logic and deals with truth values only. The values of truth varies from all the values in between 0 and 1. These truth values can encompasses all the numbers between 0 and 1. It does not hold only with both true and false values such as Boolean algebra. The membership functions organized these truth values. It basically provides approximate reasoning.

The rest of the paper is structured into a set of sections. Section 2 discusses the related work of sentiment analysis. Section 3 presents an architecture of the designed approach based on fuzzy logic for measuring customer loyalty using sentiment analysis. Section 4 presents the results of the experiments and the paper is concluded with the future work in Section 5.

## **2. Literature Survey**

In the recent years, sentiment analysis has gained much attention in the field of research. It has many paybacks and useful applications in the field of business, most probably in e-commerce [3–7]. It can give business many profitable gains and visions into how customers think and feel about products and services [8]. It also provides people a better option when they are trying to buy anything online. They know everything which they want to know just by clicking the button and reading the previous reviews about the product [9,10]. Sentiment analysis is a vast area of research because it is a very valuable action for businesses running online. Many people performed research on the sentiment analysis from the previous years and it always provides a remarkable gain in the business. Many researchers show much interest towards it and nowadays it gains major attention [11]. It takes a wide range of importance in industry as well as from a study point of view. Sentiment analysis provides measurable study for mining out the knowledge coming from a consumer's opinion, moods, emotions and feelings towards the product and their characteristics [12]. Today the world has become a global village and the use of internet is excessively growing day by day. So, the demand of the internet is also increased and people prefer online shopping rather than going to malls. So, the review (sentiments) from online customers becomes a need for businesses, other consumers and producers as well [13].

Fuzzy logic is a method which calculates value based on degrees of truth other than the typical 1 or 0. The modern computer is based on Boolean logic (True or False). A lot of work has done on sentiment analysis by using fuzzy logic approach. A method for feature mining from the online reviews of the product was suggested by Indhuja et al. [14]. The feature-based sentiment extraction method categorized into positive, negative and neutral features. Research has been done on it to eliminate noises and for feature mining. It was prolonged to include the result of linguistic borders and fuzzy roles to copy the product of concentrators, transformers and also dilators. The technique was evaluated on SFU (Simon Fraser University) review corpus and the conclusions indicated that fuzzy logic executed flawlessly in sentiment analysis. A theory based on fuzzy logic approach in which sentiment sorting of Chinese sentence-level was projected [15]. This theory of fuzzy set provides the direct way to allocate the core fuzziness between the polarity modules of sentiments [20,21]. For a further procedure of fuzzy sentiment extraction, at the beginning it mentions a technique for measuring the intensity of sentiment sentences. After this it describes fuzzy set which determines the sentiment polarity score. It provides three fuzzy sets which are positive, negative and neutral sentiments. It builds a membership functions on the basis of sentiment intensities which designate the sentiment text measure in many fuzzy sets. The conclusion gives polarity of sentiment sentence level by the use of the maximum membership value.

A technique used for the collection of reviews, blogs and comments from the social networking sites, it differentiates subjective and objective reviews. We take a subjective type review in order to extract sentiment scores from the dictionary of SentiWordNet. Here the polarity of relative sentence structure is obtained from the SentiWordNet dictionary which are positive, negative and neutral scores. This technique of research performs machine learning and word-level approaches [17]. This proposed technique attains a precision of 97.8% at the view andfeedback level and 86.6% at the sentence level.

In a paper addressing sentiment analyzing techniques using movie reviews using sentiment sorting methods [18], the text at document level yields the polarity scores of the person discussed in reviews. It uses a dictionary of SentiWordNet to analyze every word scores involved in the reviews or comments. There are three types of scores of sentiment words which are positive, negative and neutral as well. It also uses a fuzzy logic technique and its rule base method for carrying out the output. It also uses precision, Recall and accuracy method in order to determine the efficiency of the project. In a similar research, a fuzzy logic approach was used to solve the cloudiness in natural languages. This paper proposed an aspect oriented sentiment classification. They use fuzzy logic for extracting the polarity scores of opinions such as positive, strongly positive, negative and strongly negative [20,21]. It includes objective and subjective types of sentences. It also involves non-opinionated reviews by using the IMS (Imputation of Missing Sentiment) technique. IMS is used for extracting accurate results. Researchers used fuzzy logic for the sentiment modules of reviews. The results explore that for mining of the effective conclusions, this framework is feasible [22].

A model [23] was proposed which provides broadcasting of the fuzzy logic for conception polarities. The researchers describe the ambiguity created by the fuzzy logic useful to diverse areas. This technique joined two linguistic properties, which are named as SenticNet and WordNet. After that a graph is plotted by the propagation algorithm of consequent data. It was broadcasted sentiment of characterized (labeled and un-labeled) datasets. The proposed work was implemented and performed on the dataset. The conclusions show the achievability in problems. Applications of Sentiment analysis took a very vital role in the social networking sites [24]. Nowadays social media becomes a place where mostly people express their emotion, feelings and also comment about their current shopping from any social networking. A particular attention should be given also to the application of sentiment analysis in social networks. The social network environment explores new tasks because many different behaviors and people show their opinions, as defined in this paper, which discuss "noisy data", which is actually the main obstacle in the analysis of the text extracted from social networks [25,26].

Negation recognition and polarity enhancer influence the polarity score in a very unusual way. So, the polarity of a specific word is not sufficient and dependable for overall results. This paper describes all the probable techniques which are used to sense problems for the exact polarity of sentences and for the accuracy of sentiment analysis [27–29]. Some other works in sentiment analysis and opinion mining are addressing the problem in general [30–32]. None of these works target task-oriented sentiment analysis.

#### **3. Materials and Methods**

An approach is presented for measuring sentiments of users regarding their comments of a particular product. In our approach, we have attributed polarity analysis and then used a fuzzy logic approach to attribute the loyalty of a customer to a product. The used approach also involves a set of libraries such as core NLP, SentiWordNet library, etc. The users' comments, or reviews are collected from social media and famous e-shopping website AMAZON.com. The sentiment analysis is performed on the products' reviews to measure P-N polarity. Afterwards, to measure customer loyalty on the basis of sentiment score calculated from the reviews, a fuzzy logic method [20] is applied. This approach replicates the way of decision making in human being that includes all the possibilities between digital values YES and NO. The standard logic that a computer can easily understand takes specific input and produces a certain output as TRUE or FALSE or 1 or 0, which is equal to the human YES or NO. The fuzzy logic works on the levels of possibilities of input to achieve the definite output and is also called many valued logic, which only deals with the truth values [4]. It is also known as many valued logic and deals with truth values only. The values of truth varies from all the values in between 0 and 1. These truth values can encompasses all the numbers between 0 and 1. It does

not hold only with both true and false values such as Boolean algebra. The membership functions organized these truth values. It basically provides approximate reasoning.

Figure 2 shows the basic structure of sentiment analysis architecture. Sentiment analysis has many different structures based on a phrase, sentence and documents level. The process of collection of data and recognition is the calculating the data obtained from different means.

**Figure 2.** Research Architecture of proposed methodology.

After the lemmatization process, we tagged text by PoS (Parts-of-Speech) tagger. We take POS tagger of Stanford Core NLP (natural language processing). A PoS tagger is very beneficial for sentiment analysis because a POS tagger can differentiate words that can be used in different parts of speech and it is capable of filtering out the words which are not necessary, i.e., we do not need nouns or pronouns because they do not contain any type of sentiments and at the same time adjectives express the sentiments. After this step, we do the most important thing which is sentiment analysis on the text reviews which are being parsed by Stanford POS tagger. We use SentiWordNet 3.0.0 (ISTI, CNR, Rome, Italy) for the analysis. We use a technique for calculating in which a review is positive, negative or neutral and calculate the polarity of reviews by focusing upon adjectives because an adjective names an attribute or quality from which one canit easily discern the positivity, negativity and neutrality scores of the reviews. Then we find out the polarity scores using SentiWordNet database dictionary.

#### *3.1. Data Collection of Customer Reviews*

The processing of the used approach starts with the collection of users' reviews, comments, posts and tweets regarding a particular product from various sources such as social media, shopping websites, etc. In our approach, we have collected the dataset from Facebook and AMAZON.com website. The data is collected for a particular product suggested by the user. In this study, the customers' views and reviews of Apple products (such as Apple iPhone 6 and iPhone 7) are collected. The user gives reviews dependent of their feelings, experience or like and dislike of the product. In this study 3500 reviews were collected from social media and Amazon's website.
