*3.5. 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.,


#### *3.6. 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.0 library [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, Φ(*<sup>s</sup>*, *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 Φ(*<sup>s</sup>*, *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 synse<sup>t</sup> [13]. This shows that for all of the three classes, synse<sup>t</sup> 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.

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


**Table 1.** PoS Type output of user reviews.


**Table 2.** Methodology applied for sentiment analysis.

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:

$$Sum\\_Score = \sum\_{k=0}^{n} \binom{n}{k} \mathcal{W}^k \tag{1}$$

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.

#### *3.7. 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]:


The used fuzzy logic system introduces fractional truth values, between YES and NO.

$$A = \{ (\mathbf{x}, \ u\_A(\mathbf{x})) \mid \mathbf{x} \in X \} \tag{2}$$

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.

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