## 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:  
\[\text{TF-IDF(t,d}_{i})=\text{tf(t,d}_{i})\cdot\text{idf(t)} \tag{1}\]  
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 {tj\({}_{1}\), tj\({}_{2}\), tj\({}_{N}\)} 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:  
\[\text{TF-IDF(c}_{j},d_{i})=\sum_{k=1}^{N_{j}}\text{TF-IDF(t}_{k},d_{i}) \tag{2}\]  
The output of the _TF-IDF calculus_ component is the _emotional category matrix_ (in short, the ECM), whose element R(c\({}_{j},d_{i}\)) 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 TF-IDF(c\({}_{j},d_{i}\)) through applying the following formula:  
\[\text{R(c}_{j},d_{i})=\frac{\text{TF-IDF(c}_{j},d_{i})}{\sum_{k=1}^{M}\text{ TF-IDF(c}_{k},d_{i})} \tag{3}\]  
The i_th_ row of the ECM contains the relevancies of the M emotional categories in the i_th_ document, where the sum of all the relevancies is the unit.  
Figure 1: Schema of the FREDoC framework.  
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 \(\mathrm{R(c_{j},d_{i})}\) 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.