A Fuzzy Logic Based Intelligent System for Measuring Customer Loyalty and Decision Making

: In this paper, an intelligent approach is presented to measure customers’ loyalty to a speciﬁc product and assist new customers regarding a product’s key features. Our approach uses an aggregated sentiment score of a set of reviews in a dataset and then uses a fuzzy logic model to measure customer’s loyalty to a product. Our approach uses a novel idea of measuring customer’s loyalty to a product and can assist a new customer to take a decision about a particular product considering its various features and reviews of previous customers. In this study, we use a large sized data set of online reviews of customers from Amazon.com to test the performance of the customer’s reviews. The proposed approach pre-processes the input text via tokenization, Lemmatization and removal of stop words and then applies fuzzy logic approach to take decisions. To ﬁnd similarity and relevance to a topic, various libraries and API are used in this work such as SentiWordNet, Stanford Core NLP, etc. The approach utilized focuses on identifying polarity of the reviews that may be positive, negative and neutral. To ﬁnd customer’s loyalty and help in decision making, the fuzzy logic approach is applied using a set of membership functions and rule-based system of fuzzy sets that classify data in various types of loyalty. The implementation of the approach provides high accuracy of 94% of correct loyalty to the e-commerce products that outperforms the previous approaches.


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][4][5][6][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][9][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][15][16][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][4][5][6][7][8][9][10][11][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.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][9][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 microblogging 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][15][16][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][4][5][6][7][8][9][10][11][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 taskoriented 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.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 "PNpolarity" 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.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.

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][4][5][6][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][28][29].Some other works in sentiment analysis and opinion mining are addressing the problem in general [30][31][32].None of these works target task-oriented sentiment analysis.

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 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.
Symmetry 2018, 10, x FOR PEER REVIEW 5 of 19 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.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 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 Symmetry 2018, 10, 761 6 of 19 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.

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.comwebsite.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.

Tokenization
Each review in the data set is individually processed.The preprocessing of the reviews starts by the tokenization phase that splits a piece of review into small units such tokens.A typical tokenization process can confiscate punctuation marks from the given text and create tokens of the text.A token can be anything, a word or a symbol, etc.Here, we use Core NLP PTB Tokenizer which is actually PENN TREEBANK way of tokenization of English writing and it splits the reviews into sentences in order to make a simple review file.

Stop Words Removal
A set of meaningless or irrelevant words in a piece of text can seriously affect the accuracy of the output.Hence, removal of such stop words from the input text is an important phase in sentiment analysis of the text.In the collected user reviews, a stop word can be a number, a preposition or a person's name, a product's name, etc.Each review after tokenization goes through the stop words removal phase.The used approach uses Core NLP library [33], which helps in identifying a list of stop words.

Lemmatization
Lemmatization is a process that extracts core form of a word to a common base.The used approach banks on lemmatization phase to extract core form of a token or a word to achieve more accurate results in sentiment analysis phase [34].It can drive linked forms of words to a mutual base.Many textual documents use dissimilar forms of a word, e.g., mobile, mobiles, mobile's are all attributed to 'mobile'.

Parts-of-Speech Tagging
After the lemmatization phase, the review's text is Parts-of-Speech tagged to identify the lexical position and significance of that word in the sentence.Such lexical position and significance helps in identifying the impact of the word in the sentence.The used approach performs PoS tagging with the help of the Stanford POS tagger that is part of the Stanford CoreNLP library [33].In this PoS tagging phase, each word in a review text, gives a list of its parts of speech, e.g., Noun, Verb, Adjective, etc.The used PoS tagger "Penn Treebank Tag set" is used for PoS tagging.Besides its three English models, here we use a POS tagger which is also an English tagger and it is known as the "Penn Treebank Tag" set.It can also tokenize the sentence which means it splits the sentences for the quick understanding.It can break down the text into pieces, e.g.,

•
Input: This phone has best features e.g., screen, sound system, etc. Measuring polarity of a customer's review is a key phase in the used approach.In the used approach, the SentiWordNet 3.0.0library [35] is used to identify the polarity score of each word in a user's review.The polarity score of each word is further accumulated to find the accumulative polarity score of each review.It can formed by examining an automated classifier Φ to coordinate to each synsets of WordNet.It produces numerical scores of three types, Φ(s, p) (for p P = {Positive, Negative, Objective}) telling the powerfulness of the words in s, which consists of each of these three score values.The hypothesis shows change terms to synsets is that dissimilar nature of the same term with unlike opinion properties sometimes.Each of the three Φ(s, p) scores ranges from 0.0 to 1.0, and their sum is 1.0 for each synsets.
The Figure 3 shows the graphical representation used by SentiWordNet which represents the properties of opinion of a synset [13].This shows that for all of the three classes, synset may have non-zero scores that specify the similar terms have, in the sense for the synset.Therefore, it shows that SentiWordNet is used for the identifying and extracting polarity for subjectivity sentences.Table 1 shows output of PoS tag process and Table 2 shows the processed example of a review statement.

Polarity Analysis of Reviews
Measuring polarity of a customer's review is a key phase in the used approach.In the used approach, the SentiWordNet 3.0.0library [35] is used to identify the polarity score of each word in a user's review.The polarity score of each word is further accumulated to find the accumulative polarity score of each review.It can formed by examining an automated classifier Φ to coordinate to each synsets of WordNet.It produces numerical scores of three types, Φ(s, p) (for p P = {Positive, Negative, Objective}) telling the powerfulness of the words in s, which consists of each of these three score values.The hypothesis shows change terms to synsets is that dissimilar nature of the same term with unlike opinion properties sometimes.Each of the three Φ(s, p) scores ranges from 0.0 to 1.0, and their sum is 1.0 for each synsets.
The Figure 3 shows the graphical representation used by SentiWordNet which represents the properties of opinion of a synset [13].This shows that for all of the three classes, synset may have non-zero scores that specify the similar terms have, in the sense for the synset.Therefore, it shows that SentiWordNet is used for the identifying and extracting polarity for subjectivity sentences.Table 1 shows output of PoS tag process and Table 2 shows the processed example of a review statement.By applying all the methods and techniques of sentiment analysis process, we reach our results.The first line explains that we enter a simple review in a sentence form, then we remove stop words from a review in the second step.In the third step, we apply lemmatization on that review.In the fourth step, we use the Stanford Parts-of-Speech (POS) tagger which is used specify the important and useful parts of speech in the context.After applying POS tagging, we use another tagger of SentiWordNet POS tagger in the fifth step, which is almost same as that of the POS tagger but it calculates the score of that POS words by its weights.Here, we apply some constraints on it that it only calculates the score of adjectives in the given reviews.We only focus on the adjective based reviews because adjective is a quality word or the word that describes a noun, which is clearly represents the sentiment behind the reviews.
In the sixth step, we calculate Sentence token score per word using Equation (1) but we only use the score of adjective words in the text.In the seventh step, the score sum is used to identify the sum of all sentiment words in the given sentence.Equation (1) shows how the score sum is calculated by adding score of all words in a review: After that the eighth step shows the most important feature of sentiment analysis, which is the sentence type of the review.The sentence type of the review shows that whether the review is considered positive, neutral or negative.The sentence type of this review is positive obtained by using SentiWordNet dictionary.In the last three lines, the code executes that how much a review is positive, neutral or negative and the final result shows that it is positive because it has the highest positive score percentage.

Used Fuzzy Logic System
For finding the customer loyalty to a product, a fuzzy logic system is used.This system is based on the fuzzy set theory [36].The fuzzy sets and rule-based approach provides high performance and working for the sentiment analysis purpose.It provides a degree of truth and human reasoning.It is also used in decision making techniques.The used fuzzy logic system is based on following principles of fuzzy logic [37]: (1) In fuzzy logic, accurate reasoning is experimented as a case of limit for approximate reasoning.(3) It also provides that each logical method can be fuzzified.(4) Fuzzy logic restricts on the choice of on a collecting the variables and knowledge is understood as a flexible collection.(5) The result of inference system is broadcasting of flexible limitation.
The used fuzzy logic system introduces fractional truth values, between YES and NO.
Here, Equation (2) shows that µ A (X) is called the membership function or grade of membership, it is also a degree of truth, of x in A that plots X to the membership position M.While M contains only the two points 0 and 1, A is non-fuzzy and µ A (X) is alike to the distinctive function of a non-fuzzy set.Zero degree elements of membership are usually not taken.It can show the fractional membership to that set.It shows that the element from the set has particular degree and some particular membership functions are used that provides the degree of membership of fuzzy logic.These membership functions are the trapezoidal membership function, triangular membership function, Bell membership function and Gaussian membership function.In the proposed research, we apply a triangular membership function which is completely discussed in fuzzy membership functions approach.The core of a membership function for some fuzzy set A is defined asthat area of the universe that is specified by the whole membership in the set A. It shows that the core consists of those elements x of the universe such that µ A (x) = 1.The membership function's support for some fuzzy set A is defined as the area of the universe that is indicated by nonzero membership in the set A. Figure 4 shows, the support contains by the elements x of the universe such that µ A (x) > 0.
Symmetry 2018, 10, x FOR PEER REVIEW 9 of 19 (2) All relation used are the relation of degree in fuzzy logic.
(3) It also provides that each logical method can be fuzzified.(4) Fuzzy logic restricts on the choice of on a collecting the variables and knowledge is understood as a flexible collection.(5) The result of inference system is broadcasting of flexible limitation.
The used fuzzy logic system introduces fractional truth values, between YES and NO.
Here, Equation (2) shows that µA (X) is called the membership function or grade of membership, it is also a degree of truth, of x in A that plots X to the membership position M.While M contains only the two points 0 and 1, A is non-fuzzy and µA (X) is alike to the distinctive function of a non-fuzzy set.Zero degree elements of membership are usually not taken.It can show the fractional membership to that set.It shows that the element from the set has particular degree and some particular membership functions are used that provides the degree of membership of fuzzy logic.These membership functions are the trapezoidal membership function, triangular membership function, Bell membership function and Gaussian membership function.In the proposed research, we apply a triangular membership function which is completely discussed in fuzzy membership functions approach.The core of a membership function for some fuzzy set A is defined asthat area of the universe that is specified by the whole membership in the set A. It shows that the core consists of those elements x of the universe such that µA(x) = 1.The membership function's support for some fuzzy set A is defined as the area of the universe that is indicated by nonzero membership in the set A. Figure 4 shows, the support contains by the elements x of the universe such that µA(x) > 0.

Fuzzification
The first step in the used fuzzy logic systems is to recognize the input and output variables.In this process, the crisp input data is converted into a fuzzy set with the membership functions [38].Input variables of the fuzzy logic system are represented on the fuzzy sets by use of linguistic terms, membership functions and linguistic variables.The linguistic terms and variables are frequently the terms or the complete sentences of used natural language.When we are setting the linguistic variables, we are confident enough that no numerical values are used in the linguistic variables.The two vital points Fuzzy sets and fuzzy membership functions which are needed to be used to obtain the fuzzified values.The conversion of crisp input values into fuzzy values are performed by use of Membership Functions and this method of transformation is known as fuzzification.Every membership function signifies a feature of the linguistic variable being fuzzified.As we take this the membership function approach of linguistic variables in our research, we take "Sentiment Score" and "Customer Loyalty" as an input variables which may "Pos" "Neu" "Neg", and the membership function of linguistic variable "Customer Loyalty" is "Pesudo" and "Latent", "True".We described the fuzzified set by following relation:

Fuzzification
The first step in the used fuzzy logic systems is to recognize the input and output variables.In this process, the crisp input data is converted into a fuzzy set with the membership functions [38].Input variables of the fuzzy logic system are represented on the fuzzy sets by use of linguistic terms, membership functions and linguistic variables.The linguistic terms and variables are frequently the terms or the complete sentences of used natural language.When we are setting the linguistic variables, we are confident enough that no numerical values are used in the linguistic variables.The two vital points Fuzzy sets and fuzzy membership functions which are needed to be used to obtain the fuzzified values.The conversion of crisp input values into fuzzy values are performed by use of Membership Functions and this method of transformation is known as fuzzification.Every membership function signifies a feature of the linguistic variable being fuzzified.As we take this the membership function approach of linguistic variables in our research, we take "Sentiment Score" and "Customer Loyalty" as an input variables which may "Pos" "Neu" "Neg", and the membership function of linguistic variable "Customer Loyalty" is "Pesudo" and "Latent", "True".We described the fuzzified set by following relation: Symmetry 2018, 10, 761 10 of 19 In equation (3), the fuzzy set K(x i ) is called as kernel of fuzzification.To apply this technique, µ A is constant and x A is being converted to a fuzzy set K(x i ).This equation is used in the fuzzification process in which Universe of Discourse and membership function are being applied.
In our paper, we take the sentiment analysis score as an input linguistic variable and customer loyalty as an output linguistic variable as shown in Table 3.We again define linguistic terms for each input and output linguistic variables.The input linguistic variable is sentiment scores and we assigned mainly three linguistic terms.These linguistic terms are Positive, neutral, negative as shown in Table 4.The output linguistic variable we taken Customer loyalty (LO) also have three linguistic terms, these linguistic terms are True loyalty, pseudo loyalty and latent loyalty, shown in Table 5.

Membership Function
For taking decision on the input crisp values, a triangular membership function is used in our approach.The function of fuzzy sets that are achieved by crisp values of linguistic variables and show the relationships of these crisp values to the set are divided as a membership function.It is actually degree of truth that occurs between 0 and 1.There are many different kinds of membership functions, i.e., triangular MF, Trapezoidal MF, Gaussian MF, etc.It is used to plot the values of non-fuzzy sets to linguistic fuzzy sets.
Triangular Membership Function: In our research we use a triangular membership function which describes in fuzzy membership functions approach as shown in Figure 5. Fuzzy logic involves precise logical operations and these are little bit unlike those used in logic of approximate degree of truth, they are conjunction, disjunction and negation.In order to get the smallest values from the all available fuzzy variables, we use a minimum function known as conjunction.
In equation ( 3), the fuzzy set K(xi) is called as kernel of fuzzification.To apply this technique, µA is constant and xA is being converted to a fuzzy set K(xi).This equation is used in the fuzzification process in which Universe of Discourse and membership function are being applied.
In our paper, we take the sentiment analysis score as an input linguistic variable and customer loyalty as an output linguistic variable as shown in Table 3.

Type
Linguistic Variables Input Linguistic Variable Sentiment analysis score (SA) Output Linguistic Variable Customer loyalty (LO) We again define linguistic terms for each input and output linguistic variables.The input linguistic variable is sentiment scores and we assigned mainly three linguistic terms.These linguistic terms are Positive, neutral, negative as shown in Table 4.

Type
Linguistic Variable Linguistic Terms Input Sentiment analysis score (SA) {Positive, neutral, negative} The output linguistic variable we taken Customer loyalty (LO) also have three linguistic terms, these linguistic terms are True loyalty, pseudo loyalty and latent loyalty, shown in Table 5.

Type
Linguistic Variable Linguistic Terms Output Customer loyalty (LO) {True loyalty, pseudo loyalty, latent loyalty}

Membership Function
For taking decision on the input crisp values, a triangular membership function is used in our approach.The function of fuzzy sets that are achieved by crisp values of linguistic variables and show the relationships of these crisp values to the set are divided as a membership function.It is actually degree of truth that occurs between 0 and 1.There are many different kinds of membership functions, i.e., triangular MF, Trapezoidal MF, Gaussian MF, etc.It is used to plot the values of non-fuzzy sets to linguistic fuzzy sets.
Triangular Membership Function: In our research we use a triangular membership function which describes in fuzzy membership functions approach as shown in Figure 5. Fuzzy logic involves precise logical operations and these are little bit unlike those used in logic of approximate degree of truth, they are conjunction, disjunction and negation.In order to get the smallest values from the all available fuzzy variables, we use a minimum function known as conjunction.Figure 5 shows a triangular membership function.For example, we take three fuzzy variables a, b and m and also with their truth values of 0.3, 0.6 and 0.9, correspondingly; as shown in Equation ( 4): Just like the last solved example, we take the max function now just as we find the min function.Here, disjunction involves the maximum function as shown in Equation ( 5): In our research, we use a triangular membership function.We use this membership function because it maintains three variables and creates a relation between them.Here we categorize sentiments analysis score into three linguistic terms that identifies the sentiment scoring of reviews.These linguistic variables are used for evaluating customer loyalty.These terms are Positive (a), Negative (b), Neutral (m).Here we take only the subjective reviews for sentiment analysis because subjective reviews can easily state the opinion of the consumer.Here we prefer triangular membership function also known as trimf because we take three linguistic variables, i.e., a, b and x, where trimf describe by a lower limit a, an upper limit b, and a value c, where a < c < b as shown Equation (6).
where a, b and m represent the x-coordinates for triangle, x represents the crisp value from the isolated variable fuzzy universe of discourse.We classified the sentiment score into three parts: We use these sentiment scores in order to evaluate loyalty of customers towards online products.In our proposed method, we use three types of loyalty which distinguish how much the consumer is loyal towards the product and services and their values lies according the fuzzy logic triangular membership function.

•
In Pseudo Loyalty, the value in trimf lies between 0.0 < x < 0.30 because the consumer is not long-lasting whether they are buying from you in the future or choose any other opportunity.It is referred as low loyalty.

•
In Latent Loyalty, the value in trimf lies between 0.30 ≤ x < 0.70 because the consumer prefers not to purchase anything from any brand but if they are going to purchase they will always buy from one brand.It is referred as medium loyalty.

•
In True loyalty, the value in trimf lies between 0.70 ≤ x ≤ 1.0 because the consumer is only loyal to a product.They are trustworthy and always refer the product to their family, friends and relatives.They will never switch from the brand.It is also known as High Loyalty.
Here we take three different types of customer loyalty which are denoted by triangular membership functions as shown in Equation (7): where "x" is the review taken from the file, "pA(x)" is the membership of positive reviews, oA(x) is the membership of neutral reviews and nA(x) is the membership of negative reviews.We take sentiment analysis as an input, which shows that the value lies between • 0.0 to 0.3 is taken as negative.• 0.3 to 0.7 is taken as neutral.• 0.7 to 1.0 is taken as positive.
We plot a graph showing these sentiment values and terms by using MATLAB which is given below: By taking the input linguistic variables-Sentiment analysis score.The Figure 6 shows indicates that Sentiment analysis score greater 0.7 is positive.Hence, all scores lie between 0.7 and 1 will always be positive.Table 6 defines rules which are written in the form of given technique in MATLAB.The given figure shows that if our sentiment score is positive, i.e., it lies in the values between 0.7 to 1, then our loyalty is true.
By following these rules, suppose the degree of membership for x is 0.45 to the MF medium, then the loyalty will be also 0.45 medium.

Defuzzification
Defuzzification is the method which generates quantifiable results in crisp logic which is achieved from fuzzy sets and membership functions with consistent degrees.It is the method that plots a fuzzy set to a crisp set.It uses a set of rules that change a number of variables into a fuzzy result.It produces computable results which contains fuzzy sets and membership functions.It performs mapping output of fuzzy sets into crisp values.Here, we take triangular MF which defines the exact conclusions.If the degree of the membership function is not equal to 1, we have to use a trapezoidal shape instead of a triangle shape.Here are some rules which tell us relation between sentiment score and type of loyalty [14].
The last step in the fuzzy logic system is the defuzzification.After the implementation is complete in the inference step, we achieve an output value and the output value obtained from it is known as fuzzy value.In order to signify this fuzzy value in a proper way, we required to convert it into Crisp Output Value.The process of converting the fuzzy value into Crisp Output Value is known as Defuzzification Output Membership Function for "Customer Loyalty": We convert the fuzzy output to the crisp output which is formed by the steps of fuzzy inference system, the Customer Loyalty Membership function is taken as output MF.It consists of the different types of Customer Loyalty which are calculated by firm value of sentiment score.Such as, if sentiment score is in between 0.75 then loyalty will also be increase at the almost same level of 0.75 and this type of loyalty is known as "True Loyalty".We apply defuzzification rules to clarify the relation process between sentiment score and customer loyalty.
Defuzzification rules: Here are some rules of defuzzification where 'x' denotes the sentiment score while 'y' denotes the type of loyalty: if (0.0 ≤ x < 0.30), then y = 'Pseudo Loyalty' if (0.30 ≤ x < 0.70), then y = 'Latent Loyalty' if (0.70 ≤ x ≤ 1.0), then y = 'True Loyalty' Figure 7 shows a graphical representation of triangular membership functions in which we consider sentiment score on the x-axis while membership on the y-axis.These score of sentiments analysis shows how much loyalty we achieved from the reviews of the online products.We noticed that the most of the sentiment values occurs between 0 and 1; this shows our graph gives almost positive results.Here is algorithm which presents the functionality and working of triangular membership function graph.This graph shows x as a vector and three points a, b and c are the scalar, where "a" is the lower limit from where our sentiment score starts increasing, it is also known as "min" function while "b" is the peak limit or level from the sentiment score are stop increasing and it is also known as "max" function and "c" is the middle point or the value where our sentiment score achieve its highest point, such as in the following chart, the curve of the graph is at the highest level of 0.7, which means that most of our reviews lies at this point between positive and neutral.Here x-axis denotes the sentiment score lie between 0.0-1.0 and the y-axis denotes the values of membership.that the most of the sentiment values occurs between 0 and 1; this shows our graph gives almost positive results.Here is algorithm which presents the functionality and working of triangular membership function graph.This graph shows x as a vector and three points a, b and c are the scalar, where "a" is the lower limit from where our sentiment score starts increasing, it is also known as "min" function while "b" is the peak limit or level from the sentiment score are stop increasing and it is also known as "max" function and "c" is the middle point or the value where our sentiment score achieve its highest point, such as in the following chart, the curve of the graph is at the highest level of 0.7, which means that most of our reviews lies at this point between positive and neutral.Here xaxis denotes the sentiment score lie between 0.0-1.0 and the y-axis denotes the values of membership. Algorithm:

Experiments and Results
The results can be obtained by the use of algorithm of SentiWordNet and fuzzy logic.We collect reviews as an input.These are opinion sentences collection which is collected from the website www.Amazon.comand these are the reviews or comments expressed by the customers.We collect and store 1000 comments for two different Apple products.Once the reviews are taken out, then we applied pre-processing on it, parsed, tokenize and lemmatize these reviews.These sentences show positive, negative and neutral type sentiments scores.So the results of sentiments scores are measured by using SentiWordNet 3.0 software.Here we show sentiment analysis process of a single review and we applied these above mentioned techniques in Java by using the platform "Eclipse".We choose this software because it takes less effort and made our task easier.We take simple review as an input and achieve our desired results.
We take the complete results of the sentiments analysis achieved by the reviews.We take a sentence level approach in which we take a single review and apply sentiment analysis on it.In order to calculate the percentage of total number of positive reviews, total number of neutral reviews and total number of negative reviews, we collect the total results obtained from sentiment analysis and take their percentage.From the above mentioned results shows that we have 320 reviews are positive, 105 are neutral reviews while 75 are negative reviews from the collection of 500 reviews.In order to calculate the percentage of positive, neutral and negative, we use a following formula.

Experiments and Results
The results can be obtained by the use of algorithm of SentiWordNet and fuzzy logic.We collect reviews as an input.These are opinion sentences collection which is collected from the website www.Amazon.comand these are the reviews or comments expressed by the customers.We collect and store 1000 comments for two different Apple products.Once the reviews are taken out, then we applied pre-processing on it, parsed, tokenize and lemmatize these reviews.These sentences show positive, negative and neutral type sentiments scores.So the results of sentiments scores are measured by using SentiWordNet 3.0 software.Here we show sentiment analysis process of a single review and we applied these above mentioned techniques in Java by using the platform "Eclipse".We choose this software because it takes less effort and made our task easier.We take simple review as an input and achieve our desired results.
We take the complete results of the sentiments analysis achieved by the reviews.We take a sentence level approach in which we take a single review and apply sentiment analysis on it.In order to calculate the percentage of total number of positive reviews, total number of neutral reviews and total number of negative reviews, we collect the total results obtained from sentiment analysis and take their percentage.From the above mentioned results shows that we have 320 reviews are positive, 105 are neutral reviews while 75 are negative reviews from the collection of 500 reviews.In order to calculate the percentage of positive, neutral and negative, we use a following formula.Table 7 shows the accuracy of different types of reviews.We can more explain the number of Positive, neutral and negative reviews in the form of bar graph and their corresponding percentages in the form of pie graph of Apple iPhone 6s plus as shown in Figures 8 and 9. Negative (%) = 15% Table 7 shows the accuracy of different types of reviews.We can more explain the number of Positive, neutral and negative reviews in the form of bar graph and their corresponding percentages in the form of pie graph of Apple iPhone 6s plus as shown in Figures 8 and 9.

Sentiment Positioning Sentence Level Accuracy
Positive 94% Negative 91% Neutral 85%   We also use fuzzy logic for the evaluating the loyalty with sentiment scores.We apply the rules which are simulated in MATLAB, these rules show the relation between sentiment score with types of loyalty, e.g., we see in the following figure that if we have sentiment score say 0.5 than our loyalty is also 0.5.Sentiment score are directly proportional to the type of customer loyalty, we can also say that if our sentiment score is 0.5, it is considered as neutral, the loyalty also lies at 0.468, very close to the value of sentiment score and this type of loyalty is considered as Latent loyalty (see Figure 10).We reached the conclusion that the online customers of Apple iPhone 6s plus mobile are very loyal as compared to other mobiles.It achieves the loyalty score of 64%.The features of Apple iPhone 6s plus are more reliable and their most of the online customers are satisfied with this product and services as well.It supports all the new versions and feature such as camera, memory and battery timings, etc. Table 8 shows a comparison of the results of our approach with the results of previous approaches.We also use fuzzy logic for the evaluating the loyalty with sentiment scores.We apply the rules which are simulated in MATLAB, these rules show the relation between sentiment score with types of loyalty, e.g., we see in the following figure that if we have sentiment score say 0.5 than our loyalty is also 0.5.Sentiment score are directly proportional to the type of customer loyalty, we can also say that if our sentiment score is 0.5, it is considered as neutral, the loyalty also lies at 0.468, very close to the value of sentiment score and this type of loyalty is considered as Latent loyalty (see Figure 10).We also use fuzzy logic for the evaluating the loyalty with sentiment scores.We apply the rules which are simulated in MATLAB, these rules show the relation between sentiment score with types of loyalty, e.g., we see in the following figure that if we have sentiment score say 0.5 than our loyalty is also 0.5.Sentiment score are directly proportional to the type of customer loyalty, we can also say that if our sentiment score is 0.5, it is considered as neutral, the loyalty also lies at 0.468, very close to the value of sentiment score and this type of loyalty is considered as Latent loyalty (see Figure 10).We reached the conclusion that the online customers of Apple iPhone 6s plus mobile are very loyal as compared to other mobiles.It achieves the loyalty score of 64%.The features of Apple iPhone 6s plus are more reliable and their most of the online customers are satisfied with this product and services as well.It supports all the new versions and feature such as camera, memory and battery timings, etc. Table 8 shows a comparison of the results of our approach with the results of previous approaches.We reached the conclusion that the online customers of Apple iPhone 6s plus mobile are very loyal as compared to other mobiles.It achieves the loyalty score of 64%.The features of Apple iPhone 6s plus are more reliable and their most of the online customers are satisfied with this product and services as well.It supports all the new versions and feature such as camera, memory and battery timings, etc. Table 8 shows a comparison of the results of our approach with the results of previous approaches.
The results shown in Table 8 represent that previous approaches mainly performed in precision that varies from 58.2 to 87.5% whereas recall for the previous approaches is quite low and ranges from 52.0 to 79.44%.Similarly, the F-Score of previous approaches is also lower 53.0 to 77.98%.Our approach performs better as precision of our approach is 89.32%, recall is 80.36% and F-Score is 83.69%.The improvement in precision is minor however, the major improvement is in recall and F-measure.The results of the presented approach for measuring customer loyalty to a product using sentiment analysis are shown in Figure 11 and the results are also compared with the previous approaches.The results show that our approach performs better than the previous approaches available in literature.The results shown in Table 8 represent that previous approaches mainly performed in precision that varies from 58.2 to 87.5% whereas recall for the previous approaches is quite low and ranges from 52.0 to 79.44%.Similarly, the F-Score of previous approaches is also lower 53.0 to 77.98%.Our approach performs better as precision of our approach is 89.32%, recall is 80.36% and F-Score is 83.69%.The improvement in precision is minor however, the major improvement is in recall and Fmeasure.
The results of the presented approach for measuring customer loyalty to a product using sentiment analysis are shown in Figure 11 and the results are also compared with the previous approaches.The results show that our approach performs better than the previous approaches available in literature.
A limitation of the presented implementation is that it processes only English language text that is grammatically correct and has no spelling mistakes in text.

Conclusions and Future Work
This paper addresses an important problem of measuring customer's loyalty to a specific product.Previously, general purpose sentiment analysis of tweets and posts are carried out however a task-oriented sentiment analysis of users' reviews of a product to find key features liked by the users and their confidence level is a new idea.In this paper, we presented a novel idea of using a fuzzy logic approach for measuring customer's loyalty to a product with the help of a sentiment analysis score.We use a Fuzzy logic approach which used membership functions and rule-based system of fuzzy sets which is used classifies the types of loyalty.It attained the average accuracy of 94% of positive which shows the number of customers which are loyal to the e-commerce products.
In this study we have experimented with the small sized reviews that are processing in separate sentences.In future, we aim to extend the ability of the implementation to process and handle large sized text.In the future, this work can be extended by considering both sentence types, i.e., subjective Bagheri, et al. [3] Guzman, et al. [35] Thet et al. [36] This Approach

Comprison with previous appraoches
Precision % Recall % F-Score % [39] [40] A limitation of the presented implementation is that it processes only English language text that is grammatically correct and has no spelling mistakes in text.

Conclusions and Future Work
This paper addresses an important problem of measuring customer's loyalty to a specific product.Previously, general purpose sentiment analysis of tweets and posts are carried out however a task-oriented sentiment analysis of users' reviews of a product to find key features liked by the users and their confidence level is a new idea.In this paper, we presented a novel idea of using a fuzzy logic approach for measuring customer's loyalty to a product with the help of a sentiment analysis score.We use a Fuzzy logic approach which used membership functions and rule-based system of fuzzy sets which is used classifies the types of loyalty.It attained the average accuracy of 94% of positive which shows the number of customers which are loyal to the e-commerce products.
In this study we have experimented with the small sized reviews that are processing in separate sentences.In future, we aim to extend the ability of the implementation to process and handle large sized text.In the future, this work can be extended by considering both sentence types, i.e., subjective as well as objective.It aims to achieve more accuracy by these techniques.It also improves the speed

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

Figure 1 .
Figure 1.A sketch of proposed approach for Customer Loyalty Measurement.
with both true and false values such as Boolean algebra.The membership functions organized these truth values.It basically provides approximate reasoning.

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

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

Figure 3 .
Figure 3.The graphical representation of sentiment analysis.

( 2 )
All relation used are the relation of degree in fuzzy logic.Symmetry 2018, 10, 761 9 of 19

Figure 4 .
Figure 4. Support of element x in a membership function.

Figure 4 .
Figure 4. Support of element x in a membership function.

Figure 5 .
Figure 5. Graphical representation of Triangular Membership Function.Figure 5. Graphical representation of Triangular Membership Function.

Figure 5 .
Figure 5. Graphical representation of Triangular Membership Function.Figure 5. Graphical representation of Triangular Membership Function.

Figure 6 .
Figure 6.The triangular fuzzy membership function plot for sentiment analysis as inputs.Figure 6.The triangular fuzzy membership function plot for sentiment analysis as inputs.

Figure 6 .
Figure 6.The triangular fuzzy membership function plot for sentiment analysis as inputs.Figure 6.The triangular fuzzy membership function plot for sentiment analysis as inputs.

Figure 7 .
Figure 7.The triangular fuzzy membership function plot for loyalty as an outputs.

Figure 7 .
Figure 7.The triangular fuzzy membership function plot for loyalty as an outputs.

Figure 8 .
Figure 8. Bar chart for the number of reviews of Apple iPhone 6s plus.Figure 8. Bar chart for the number of reviews of Apple iPhone 6s plus.

Figure 8 .
Figure 8. Bar chart for the number of reviews of Apple iPhone 6s plus.Figure 8. Bar chart for the number of reviews of Apple iPhone 6s plus.

Figure 9 .
Figure 9. Pie chart for the sentiment score Apple iPhone 6s plus (In percentage).

Figure 9 .
Figure 9. Pie chart for the sentiment score Apple iPhone 6s plus (In percentage).
Symmetry 2018, 10, x FOR PEER REVIEW 7 of 19Treebank Tag" set.It can also tokenize the sentence which means it splits the sentences for the quick understanding.It can break down the text into pieces, e.g.,• Input: This phone has best features e.g., screen, sound system, etc.

Table 1 .
PoS Type output of user reviews.

Table 1 .
PoS Type output of user reviews.

Table 2 .
Methodology applied for sentiment analysis.

Table 3 .
Input and output Linguistic Variables for proposed method.

Table 4 .
Input Linguistic Variable and Terms.

Table 5 .
Output Linguistic Variable and Terms.

Table 3 .
Input and output Linguistic Variables for proposed method.

Table 4 .
Input Linguistic Variable and Terms.

Table 5 .
Output Linguistic Variable and Terms.

Table 6 .
The fuzzy rules for calculating Customer Loyalty.

Table 7 .
Overall percentage of Sentiment Analysis of Samsung Galaxy S8.

Table 7 .
Overall percentage of Sentiment Analysis of Samsung Galaxy S8.

Table 8 .
Comparison of results with other approaches.

Table 8 .
Comparison of results with other approaches.