# A GIS-Based Hot and Cold Spots Detection Method by Extracting Emotions from Social Streams
## 3 The FESC Framework  
In [10], the social messages emotion classification method [6] shown in Figure 3 is implemented in a GIS-based framework in order to classify the districts of the municipality of Bologna (Italy). The study area is given by the municipality, and its six districts are the subzones in which the study area is spatially divided. Social messages are extracted in order to detect the moods of citizens connected to the livability of a district. Each document is related to Twitter social messages posted by citizens and tourists whose hashtags contain the name of a district. Each district is categorized using EFCM according to the dominant emotion category. The districts are then organized thematically depending on the dominant emotion type. FESC extends this framework to study the temporal evolution of the intensity of a phenomenon in a subzone and detect if a subzone constitutes a hot or cold spot. Figure 4 shows the logical view of our framework. Figure 4: FESC: logical overview. The social data extracted contain all the messages related to the analyzed phenomenon posted by users located in one of the subzones in which the study area is partitioned and in a specific period. This period is broken down into T time frames having equal duration. Let the study area be partitioned into a atomic subzones \(\mathrm{s_{1}}\), \(\mathrm{s_{2}}\),..., \(\mathrm{s_{n}}\), and the analyzed period be partitioned in T time frames. After cleaning up the text from irrelevant terms and executing the Part of Speech tagging, the Text Parsing component creates N documents aggregating messages related to the same subzone and the same time frame, where N = n\(\cdot\)T. The Term Filtering component annotates terms belonging to pleasant and unpleasant emotional categories in the Dictionary of EC words. The ERM Construction component computes the IF-TDF value of each category in the document and aggregates the values assigned to each pleasant/unpleasant category. Let \(\mathrm{\{c_{p1},c_{p2},\ldots,c_{pM_{p}}\}}\) be the set of \(\mathrm{M_{p}}\) pleasant emotional categories and \(\mathrm{\{c_{u1},c_{u2},\ldots,c_{uM_{u}}\}}\) be the set of \(\mathrm{M_{u}}\) unpleasant emotional categories, where \(\mathrm{M_{p}}+\mathrm{M_{u}}=\mathrm{M}\). If \(\mathrm{R}\) (\(\mathrm{c_{j}}\), \(\mathrm{d_{i}}\)) j = 1,...,M i = 1,..., N is the relevance of the jth category in the ith document measured by (5), the relevance of the pleasant and unpleasant emotions in the document are given by:  
\[\mathrm{R_{p,i}}=\sum_{k=1}^{M_{p}}\mathrm{R}\ \left(\mathrm{c_{kp}}, \mathrm{d_{i}}\right) \tag{6}\]  
\[\mathrm{R_{u,i}}=\sum_{k=1}^{M_{u}}\mathrm{R}\ (\mathrm{c_{ku}},\mathrm{d_{i}}) \tag{7}\]  
where \(\mathrm{R_{p,i}}+\mathrm{R_{u,i}}=1\ \forall\ i=1,\ldots,\mathrm{N}\). The output of this process is a two-columns matrix called the _Pleasant/Unpleasant ER matrix_ in which are assigned, for each document, the relevance of pleasant and unpleasant emotional categories given, respectively, by Equations (6) and (7). The Document Classification component fuzzifies pleasant and unpleasant category relevancies using a user-built fuzzy pleasant/unpleasant category relevance partition called ECR fuzzy partition. The ith document is classified with pleasant/unpleasant emotion relevance equal to the label of the fuzzy set to which \(\mathrm{R_{pi}}\) (\(\mathrm{R_{uil}}\)) belongs with the highest level of membership. The hot and cold spot thematic map creation component analyzes all the documents associated with a subzone, where each document refers to the emotional manifestations and discomorts expressed in social posts residing in the subzone in a given time frame. If all the documents are classified with the relevance of unpleasant emotions above a specified threshold, then the subzone is labeled as a hot spot; likewise, if all documents are classified with the relevance of pleasant emotions above a specified threshold \(\mathrm{\hat{R}}\), the subzone is labeled as a cold spot.