## 2 Materials and Methods
### The FREDoC Framework  
FREDoC [10] is a fuzzy-based emotion multi-classification model used to classify documents considering the prevalence of pleasant and unpleasant emotions detected in the text. It was used in [19; 20; 21] to classify urban areas and urban facilities based on the relevance of pleasant and unpleasant emotions detected in posts published on a social network. Formally, let D = [d\({}_{1}\), d\({}_{2}\),... d\({}_{\text{N}}\)] be a corpus of N documents where each document contains the set of texts coming from a data flow that refers to common keywords (for example, the same entity, the same geographical area, or the same period). A text-parsing algorithm is used to remove irrelevant words in the texts and to stem the other words. A dictionary of emotional terms, called a Dictionary of Emotional Category words, is built to detect in the document all of the terms, identified in their inflectional form, that are connected to emotions. In [10], the Plutchick wheel of emotions is used; it divides emotions into sixteen categories: eight primary emotions and eight secondary emotions(Table 1). Each term related to an emotional category is inserted into the catalog in its inflectional form. To measure the relevance of a term appearing in a document, we calculated its Term Frequency Inverse Document Frequency information retrieval index (tf-idf). The tf-idf index evaluates the frequency with which the term appears in the document in relation to the frequencies with which it appears in other documents in the corpus. Let \(\{d_{1},d_{2},\ldots,d_{N}\}\) be the corpus given by N documents. If \(t_{jk}\) is the kth term assigned to an emotional category, the tf-idf of this term in the document \(d_{i}\) is given by tf-idf (\(t_{jk}\), \(d_{i}\)). In [10], the relevance of the jth emotional category in the ith document is given by  
\[r(c_{j},d_{i})=\frac{\sum_{k=1}^{T_{j}}tf-idf(t_{jk},d_{i})}{\sum_{s=1}^{N} \sum_{h=1}^{T_{h}}tf-idf(t_{hs},d_{i})} \tag{1}\]  
where \(T_{j}\) is the number of terms assigned to the jth emotional category in the dictionary. The relevance \(r(c_{j},d_{i})\) is given by the sum of the tf-idf of all terms belonging to the jth emotional category divided by the sum of the tf-idf of all terms in the dictionary. It is normalized in \([0,1]\) using the formula  
\[r^{{}^{\prime}}(c_{j},d_{i})=\frac{r(c_{j},d_{i})}{\sum_{h=1}^{C}r(c_{h},d_{i })} \tag{2}\]  
in which it is divided by the sum of the relevance of all emotional categories in the ith document. Subsequently, the relevance values are fuzzified by building a fuzzy partition in the discourse universe \([0,1]\), where the fuzzy partition is composed of fuzzy sets that respect the Ruspini constraint [22] that the sum of the membership degrees of an emotional category to all of the fuzzy sets is equal to 1. FREDoC performs the multi-classification of each document of the corpus by assigning to it for each emotional category the linguistic label of the fuzzy set with the highest membership degree. This linguistic label is called the fuzzy relevance of the emotional category in the document. As an example, Figure 1 shows a fuzzy partition of the domain of relevance of emotional categories composed of five triangular fuzzy numbers: low, medium low, medium, \begin{table}
\begin{tabular}{c c c} \hline \hline
**Type of Emotion** & **Pleasant/Unpleasant** & **Emotional Category** \\ \hline \multirow{4}{*}{Primary} & \multirow{4}{*}{Pleasant} & Joy \\  & & Trust \\  & & Surprise \\  & & Expectation \\ \cline{2-3}  & & Fear \\  & & Sadness \\  & & Disgust \\  & & Anger \\ \hline \multirow{4}{*}{Secondary} & \multirow{4}{*}{Unpleasant} & Optimism \\  & & Love \\ \cline{1-1}  & & Aggression \\ \cline{1-1}  & & Submission \\ \cline{1-1}  & & Disapproval \\ \cline{1-1}  & & Contempt \\ \cline{1-1}  & & Remorse \\ \cline{1-1}  & & Awe \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Emotional category in the Plutchick wheel. medium high, and high. Each triangular fuzzy number is a fuzzy set represented by three points.