1. Introduction
Thanks to the expansion of the Web and social media, most of the world’s population today shares textual and multimedia content to express their opinions and feelings about entities, events, places, or people. The use of sentiment analysis (SA) and emotion detection (ED) algorithms makes it possible to analyze the unstructured flows generated on the Web to recognize the predominance of pleasant or unpleasant emotions and to detect the characterizing ones.
The arrival of Web 3.0, in which the Web will evolve into a complex decentralized database based on ontological languages, will allow access to a much wider, more structured and complete set of information related to users’ experiences and preferences, while maintaining necessary transparency in compliance with all privacy constraints. Already today the Web lives towards a progressive evolution from dynamic Web 2.0 to Web 2.5 in which there are more and more artificial intelligence applications such as SIRI, Google Assistant, and Alexa, which are able to understand the context; moreover, the opportunity to receive benefits and also economic benefits, determines an increasing involvement of users in interacting with applications.
In this context, the SA and ED techniques play an even more significant role, with them being capable of capturing and classifying consumers’ sensations and likings in the use of products and services.
SA and ED techniques are today applied in various fields to analyze unstructured texts posted on the Web and apply natural language processing (NLP) methods to determine the positive or negative opinion of users.
In particular, ED methods analyze the text to detect and identify the presence and predominance of different types of feelings and emotions using a specific model of partitioning the types of emotions. Dimensional emotions models define emotions by two or three independent dimensions. In the Russel model [
1], all emotions are controlled by two independent dimensions: hedonic (pleasure–displeasure) and arousal (rest–activated). In [
2], the emotional state of a person is determined by three parameters: valence, arousal, and power, representing polarity, excitation intensity, and the capacity for restriction on emotions.
Categorical emotion models are used to detect and classify emotions in documents. These models are based on the fact that the emotional state is recognizable through the analysis of a basic set of pleasant and unpleasant emotions. Two emotion models are generally used to classify emotions: the Elkman model [
3], in which emotions are reduced to six basic emotional categories, and the Plutchik model [
4], which classifies emotions into eight pleasant and unpleasant basic emotion categories and eight secondary emotion categories derived from combinations of two basic emotion categories.
NLP methods are generally applied to carry out the morphological, syntactic, and semantic analysis of the text, in order to extract information necessary to detect emotional states. Recently, to ensure the accurate text analysis of documents, highly performing NLP neural network models have been proposed [
5,
6] and some authors apply deep learning methods for sentiment classification and sentiment extraction in data streams [
7,
8]. However, in some cases neural and deep learning models are unsuitable due to the difficulty of obtaining training data; this happens especially in streaming environments where the data flow varies continuously [
9], making it impractical to label and extract data samples and causing the presence of unbalanced classified data over time.
In some cases, semi-supervised classification methods can be used to classify unbalanced data points [
10]. However, to obtain high classification accuracy, a long training phase is necessary, which, computationally, is very expensive.
To reach a trade-off between the computational cost and the accuracy of the classifications in [
11], an emotion detection method was proposed to classify social documents according to the prevailing emotional category in which a lightweight NLP approach was used for the detection and annotation in the text of terms belonging to specific emotional categories. An extension of the Fuzzy C-means (FCM) partitive clustering algorithm is applied to classify documents where the term frequency inverse document frequency measure (TF-IDF) is used to assess the relevance of emotion categories in the document. A variation of this framework is used in [
12] to classify document extracts from tweets; the authors applied an entropy variation of FCM to classify documents using the primary and secondary pleasant and unpleasant Plutchik emotion categories and they showed that their approach improves the classification accuracy of the emotion classification framework [
11]. In [
13], a new emotion classification framework called FREDoC is proposed; it is based on a fuzzy-based emotion classification model applied instead of the FCM clustering algorithm to classify documents considering the primary and secondary Plutchik emotion categories. This approach overcomes the critical issues of the frameworks proposed in [
11,
12], with it not requiring a mapping process between the final cluster and the emotional categories and providing an immediate linguistic interpretation of the final classification of the documents. In [
13], the authors used a multi-classification technique to assign the document to the emotional categories with relevance greater than a preset threshold. The authors showed that this approach provides a better emotional classification with respect to [
11,
12], also assigning to the document significant and not negligible emotions, even if non-predominant.
An important use of the lightweight document emotion classification approach concerns the assessment of the prevailing emotions of citizens and tourists about the places and events experienced as revealed on a social network. Each document is associated with a particular place in the area of study and with a specific time interval. The results of the classification are thematic maps in which the spatial distribution of the prevailing emotional categories and their evolution over time are highlighted. The framework [
11] is implemented in a geographical information system (GIS) in [
14] for classifying urban districts based on the feelings of citizens detected from social streams. In [
15], a GIS-based emotion classification framework is proposed in which the emotion document classification model [
11] is used to classify the subzones in which the area of study is partitioned based on the relevance of pleasant and unpleasant emotion categories.
In this study, we provide a technique for capturing the prevailing feelings of users about service facilities located within the area of study expressed through reviews, opinions, and comments posted on the web. In order to carry out multi-classification of the prevailing emotions, the FREDoC model is executed to measure the relevance of each emotional category.
We implement this method on a GIS-based platform where the analyzed infrastructures on which the classification is made are located on the map.
The proposed method has the advantage of providing, with short computation times, a multi-classification of the prevailing emotional categories assigned by users to each service facility, allowing the spatial distribution of its relevance to be constructed for each emotional category and to evaluate where they are located in the service facilities in which pleasant and unpleasant emotions prevail.
Another goal of our research is to improve the assessments made by approval scales produced by review-collecting providers which are based on the subjective scores entered by users on a scale of 1 to 5. An analysis of the prevailing emotional categories expressed in user comments allows, instead, to make a more accurate evaluation of the evaluation assigned to the service infrastructure.
The main strengths of the proposed method are summarized below:
- -
A more in-depth analysis of users’ approvals and opinions with respect to the synthetic evaluations by the approval scale carried out by review-collecting providers;
- -
A complete emotional category relevance classification based on the prevailing emotional states of users that enables the determination of the spatial distribution of the relevance of each category and to determine which are the most critical and the most pleasant characteristics of each service facility;
- -
An optimal balance between the accuracy of user assessments and the computational speed provided by FREDOC in detecting the prevailing emotional categories.
The remaining sections are organized as follows:
Section 2 introduces the FREDoC framework and discusses the FREDoC fuzzy-based emotion classification method.
Section 3 presents our method applied to classify service facilities in the area of study based on the prevailing emotions detected in comments posted on the web. Finally,
Section 4 shows and discusses the results of our experiments in which we test our GIS platform to classify theater infrastructures present in the municipality of Naples (Italy) based on the prevailing emotions of the users. The conclusions and future perspectives of the research are included in
Section 5.
2. The FREDoC Emotion Document Classification Model
In this section, the FREDoC model is briefly discussed. An architectural schematization of the FREDoC framework is shown in
Figure 1.
The text parsing component analyzes the input data stream filtering only relevant terms; it brings together texts with similar characteristics such as tweets with a common hashtag relating to a subject or to a topic. The joined texts constitute documents of the corpus of documents.
Each document’s words expressing emotions are annotated by the term filtering component; these words match terms inserted into their stemmed forms in the dictionary of emotional category word, a list of terms assigned to each emotional category.
The TF-IDF calculus component calculates the TF-IDF measure for each term in the dictionary of emotional words appearing in a document.
Let the corpus of documents be composed of N documents d
1, d
2, …, d
N. Let t be a term appearing in the i
th document. Its TF-IDF index, measuring the importance of the term t in the document d
i and in the whole corpus of documents, is given by the formula:
where the first term in the Equation (1), called
term frequency, measures the relative frequency of the term t in the document d
i; it is determined by the ratio between the frequency of occurrence of the term in the document and the number of terms annotated in the document. The second term, called
inverse document frequency, measures the relevance of the term t in the corpus of the document; it is given by the decimal logarithm of the ratio between the number N of documents and the number of documents in which the term t appears.
After calculating the TF-IDF values of all terms annotated in the i
th document, the TF-IDF values of the terms assigned to each emotional category are summed up. If c
j is the j
th emotional category and {t
j1, t
j2, t
jNj} are the set of terms related to c
j, the TF-IDF value assigned to the j
th emotional category in the i
th document is:
The output of the
TF-IDF calculus component is the
emotional category matrix (in short, the ECM), whose element
provides a measure of the relevance of the j
th emotional category in the i
th document. It is obtained by normalizing in the close interval [0, 1] the value
through applying the following formula:
The ith row of the ECM contains the relevancies of the M emotional categories in the ith document, where the sum of all the relevancies is the unit.
A fuzzy partition of the emotion category relevance domain [0, 1] (emotional relevance fuzzy partition) is constructed in order to fuzzify the relevancies of an emotional category.
The document classification component classifies a document assigning as relevance of the jth emotional category in the ith document the label of the fuzzy set to whom the crisp value belongs with the greatest membership degree.
As an example, let us consider an emotional relevance fuzzy partition given seven fuzzy sets, labelled:
very low,
low,
medium–low,
medium,
medium–high,
high, and
very high and let us suppose that the membership degrees of the relevance of an emotional category in three documents to these fuzzy sets are as they are shown in
Table 1.
In the last column, the relevance assigned to this emotional category in each document is shown; it corresponds with the label of the fuzzy set with the highest membership degree.
3. The Proposed Method
Our framework imports unstructured data inserted into reviews and comments posted on the Web that refer to N service facilities (called spatial entities) located in the area of study and uses the FREDoC model to assess the relevance of user emotions.
For each spatial entity, the relevance of a set of M pleasant and unpleasant emotional categories is assessed; for this purpose, the dictionary of emotional words including in the stemmed form the terms belonging to each pleasant and unpleasant emotional category is created; in addition, the emotional relevance fuzzy partition is created.
The emotional relevance fuzzy partition is constructed as a Ruspini fuzzy partition [
33] on the domain [0, 1] of the normalized relevance values,
Let {A
1, A
2, …, A
n}, a family of n fuzzy sets defined in a domain
. It is a Ruspini fuzzy partition if the following constraints hold:
The emotional relevance fuzzy partition on the domain [0, 1] is composed of a Ruspini fuzzy partition given by a family of n fuzzy sets given by trapezoidal fuzzy numbers, in the form:
where 0 < a
k1 ≤ a
k2 ≤ a
k3 ≤ a
k4 < 1. If a
k2 = a
k3, then A
k is given by a triangular fuzzy number; if a
k1 = a
k2 = 0, then A
k is given by an R-function fuzzy number; and if a
k3 = a
k4 = 1, A
k is given by a L-function fuzzy number.
All comments posted by users relating to a spatial entity ei, after the analysis and cleaning of their content performed by the text parsing component, are grouped to form a document Di. After performing this process for each spatial entity, the corpus of documents D = {d1, d2, …, dN} will be created.
Then, the term filtering and the TF-IDF components are executed in order to obtain the emotional category matrix, whose element R(di,cj) i = 1, …, N j = 1, …, M represents the crisp normalized relevance of the emotional category cj in the ith document di.
For each document, the document classification component is executed in order to obtain the fuzzy relevance of each pleasant and unpleasant emotional category in the document; these results will be added to the correspondent spatial entity. The fuzzy relevance of the jth emotional category cj in the ith document di is given by the label of the fuzzy set of the relevance fuzzy partition to whom the element R(di,cj) belongs with the highest membership degree.
Thematic maps showing the spatial distribution of the fuzzy relevance of each emotional category are produced. In addition, a thematic map of the relevance of pleasant/unpleasant emotions is constructed.
Our method is shown structured in pseudocode in Algorithm 1.
Algorithm 1: Emotional relevance of service facilities assessment |
- 1.
Select the N spatial entities in the area of study - 2.
Create the dictionary of emotional words - 3.
Create the emotional relevance fuzzy partition on the domain [0, 1] - 4.
For each spatial entity ei i = 1, 2, …, N - 5.
Extract the data stream given by reviews and comments from the web network - 6.
Execute the text parsing component - 7.
Create the ith document Di - 8.
Next i - 9.
Execute the term filtering component on the corpus of documents D = {D1, D2, …, DN} - 10.
Execute the TF-IDF calculus component - 11.
For each document di i = 1, 2, …, N - 12.
Execute the document classification component - 13.
Join the data with relevance of each emotion category to the ith spatial entity - 14.
Next i - 15.
For each emotion category cj j = 1, 2, …, M - 16.
Construct the thematic map of the emotion category cj - 17.
Next j - 18.
Construct the pleasant/unpleasant emotions thematic map
|
We tested our framework to analyze the relevance of pleasant and unpleasant emotions expressed in reviews and comments on the Web by users who attended theatrical performances in theaters located in the municipality of Naples (Italy). For each spatial entity, the relevance of the sixteen primary and secondary emotional categories of Plutchik’s wheel were assessed.
The following section presents and discusses the test results.
4. Results and Discussion
We tested the proposed framework to analyze the emotions expressed by users for the 50 theaters located in the municipality of Naples (NA).
All 50 theaters have been georeferenced as point features on the map. Subsequently, for each theater the reviews and opinions of users posted on a set of Italian websites dedicated to reviews of service facilities were acquired; in particular, reviews written on the websites TripAdvisor (
https://www.tripadvisor.it/ accessed on 1 April 2023) and Google Maps (
https://www.google.it/maps/ accessed on 1 April 2023) were acquired, considering the reviews inserted in the last five years. Four theaters (Tasso, Spazio Libero, Auditorium di Scampia, and Villa Patrizi) were closed during this period. They were georeferenced but were not evaluated.
In
Figure 2, the area of study is shown. The 46 analyzed theaters are shown on the map filled by the light green color.
To analyze the relevance of the emotions, we use the sixteen primary and secondary emotion categories in Plutchik’s wheel of emotions (
Figure 3a). A secondary emotion category was obtained from the combination of two primary emotion categories, as displayed in the graph of the emotion primary dyads in
Figure 3b where the secondary emotion categories are displayed as connecting arrows of two primary emotions.
Table 2 shows the sixteen emotional categories where each emotional category is classified as primary/secondary and pleasant/unpleasant.
To create the emotional relevance fuzzy partition, we used a fuzzy partition composed of n = 7 fuzzy sets labelled as:
null,
low,
medium–low,
medium,
medium–high, and
very-high. The fuzzy set null is an R-function, the fuzzy set very-high is an L-function, and the other fuzzy sets are triangular fuzzy numbers.
Figure 4 shows these seven fuzzy sets.
Then, we constructed, in the Italian language, the dictionary of emotional words for the sixteen primary and secondary pleasant and unpleasant emotion categories in Plutchik’s wheel. To construct the dictionary, for each emotional category, all the known terms associated with it were analyzed; subsequently, for each term, additional terms present in synonym dictionaries were selected. Each term in the dictionary was subsequently reduced to its inflectional form.
Finally, we executed our algorithm to classify the 46 spatial entities. For each of the sixteen pleasant and unpleasant emotional categories, the thematic map of the relevance of the emotional category was extracted. Each thematic class in the map represents the fuzzy relevance label assigned to the emotional category.
In
Figure 5, the eight thematic maps of the relevance of the primary emotional categories are shown.
The relevance of the pleasant emotion categories joy, trust, and surprise are at least medium for most theatres, as well as the relevance of the unpleasant emotion category sadness.
In
Figure 6, the eight thematic maps of the secondary emotional categories are shown.
The two pleasant secondary emotional categories love and optimism are present in practically all theaters with a predominant medium relevance, whereas the unpleasant secondary emotional categories are only found in a certain number of them with a medium–high or high relevance.
These results show that our approach improves the performance of the GIS-based emotion classification platform [
14] in which the spatial entity is classified with only the prevailing emotional category and, sometimes, emotions of different polarities may be co-present. In fact, for some theaters, both pleasant emotional categories such as joy or trust and unpleasant ones such as sadness are relevant; in fact, for a complete analysis of the prevailing emotions, a multi-classification is necessary in which to also take into account emotional categories whose relevance is not negligible.
In general, the resultant maps show that the unpleasant emotional categories are present in fewer theaters than the pleasant emotional categories for the both primary and secondary emotional categories. The emotional category sadness is the only exception, as it appears in the majority of the theaters in the study area with mostly medium relevance.
The final pleasant/unpleasant emotions thematic map, which displays the theaters based on the predominance of pleasant or unpleasant emotions, is presented in
Figure 7.
The unpleasant emotional category is prevalent with a frequency of 25 theaters out of 46, which is 54% of the total, while the pleasant ones are the remaining 46%. The districts in the city center are the ones that most frequently belong to the emotional category pleasant while the western area turns out to have the largest number of theatres that belong to the emotionally unpleasant category.
Approval Scale Comparisons
To compare our results with the synthetic evaluations by using an approval scale produced by the review-collecting providers, we produced a thematic map of the relevance of pleasant emotion categories, partitioning the closed interval [0, 1] in nine thematic classes of equal breadth.
We created a thematic map of the relevance of pleasant emotional categories, partitioning the closed interval [0, 1] into nine thematic classes of equal breadth in order to compare our findings with the synthetic assessments by using approval scale produced by the review-collecting providers. We call this map the pleasant ranking map. This partitioning into nine classes is due to the fact that the rating assigned to the element by the providers is a value between 1 to 5 with a minimum sensitivity of 0.5. Each user, when entering the review, assigns a rating given by an integer from 1 to 5; the element is assigned an overall score equal to the average value of the scores assigned by all users with a minimum sensitivity of 0.5.
The nine thematic classes are displayed in
Table 3. Each class has a breadth of 0.111111.
The map with the relevance of pleasant emotion categories is shown in
Figure 8.
The preponderance of theaters (52%) falls into the less than 3 points classification with a total of 24 theaters while the remaining 48% (22 theaters) belong to the classes of 3 points or more. However, the number of theaters belonging to the 5-point class (9 theaters) is higher than those classified with 1 point (5 theaters).
The high concentration of theaters rated at 5 points resides mainly among the southern area of Naples, while a prevalence of theaters rated below 2.5 is present in the central-western area.
To compare our class rating with the rating assigned to the theaters by the providers, we measured the absolute difference between the class rating and the one assigned by the providers (scale difference).
Figure 9 shows the trend of the scale difference with respect to the pleasant emotional category’s relevance.
The plotting graph in
Figure 9 shows that on average, the difference between the two ratings increase, decreasing the pleasant emotions’ relevance.
For a relevance of less than 0.4, the average difference in the absolute value between the two scores is between 2 and 2.5. Conversely, for a significance value greater than 0.4, this difference is between 0.5 and 1.
This result shows that, probably, the subjective assignment of the score made by the user overestimates their actual evaluation inserted in the posted comment. This is in line with the result provided in [
16] in which the frequencies of scores on a scale of 1 to 5 assigned on the TripAdvisor web platform by customers to hotels and restaurants located in the city of New York (USA) were calculated. The customer, after entering their comment, can decide to assign a score. This result shows that the frequency of assignments made increases as the score increases, pointing out that the customer tends to enter a higher overall score than the one detectable from their review.
From this it can be deduced that the proposed framework, in addition to providing an in-depth analysis of the relevance of emotional categories perceived by users, provides an overall evaluation of the entity analyzed, summarized in terms of the score, which is more accurate than that provided by the review-collecting providers.
5. Conclusions and Future Works
We have proposed a new emotion detection method based on fuzzy document emotion classification to assess the relevance of pleasant and unpleasant emotions expressed by users of service facilities in their reviews. We implemented our method in a GIS platform and tested it to evaluate the degree of satisfaction of users who attended performances in theatre facilities in the municipality of Naples (Italy). A fuzzy-based approach was used to classify user satisfaction according to the relevance of the emotional categories of pleasant and unpleasant.
Plutchik’s wheel of emotions considering the primary and secondary pleasant and unpleasant emotion categories was used and the FREDoC model was implemented in a GIS platform to produce thematic maps of the relevance of each emotional category measured by analyzing user reviews on the liking of service facilities. In addition, a final thematic map of the relevance of pleasant/unpleasant emotions was produced.
We compared our results with the synthetic evaluations by using an approval scale produced by the review-collecting providers, showing that our method, in addition to providing a detailed analysis of the relevance of the emotions perceived by users, provides a more reliable overall assessment of user satisfaction than that provided by the review-collecting providers based on the score that the user enters together with their review, as, probably, the score attributed by the user overestimates the level of satisfaction found in their review.
We intend to carry out new research in the future, optimizing the proposed method to further refine the accuracy of the results in terms of the relevance of the pleasant and unpleasant emotional categories expressed in the reviews posted by users.
Furthermore, we intend to test our method in different contexts to measure the levels of satisfaction with the service facilities expressed by users.
In order to gauge the degree of customer satisfaction with the service facilities, we also plan to test our methodology in different scenarios.