## 2 Related Work
### Social Context  
Social context [1] is the collection of users, content, relations, and interactions that describe the environment in which social activity takes place. It encapsulates the frame in which communication in social media takes place.  
Social context is used in sentiment analysis for two reasons that are subtly different. First, it can be used to compensate for implicit elements in the text. An example of this is how slang, abbreviations, or semantic variations can be detected and accounted for in the classification. Humans apply a similar process when trying to understand content. Content authors also unconsciously rely on this fact, and they assume certain prior knowledge. The second motivation to add social context is that it may help correct ambiguity or situations where textual queues are lacking. For example, a classifier may use the sentiment of earlier posts by the user and similar users on the same topic.  
For the sake of clarity and for the ease of comparison with other works, we will employ the following general definition of social context [1]:  
\[SocialContext=\langle C,U,R,I\rangle \tag{1}\]  
where: \(U\) is the set of content generated; \(C\) is the set of users; \(I\) is the set of interactions between users, and of users with content; \(R\) is the set of relations between users, between pieces of content, and between users and content.  
Figure 1 provides a graphical representation of the possible links between entities of the two available types. Users may interact (\(i\)) with other users (\(I^{u}\)) or with content (\(I^{c}\)).  
\[I\equiv\{i_{t}\mid t\in Ti\}=I^{u}\cup I^{uc} \tag{2}\]  
\[I^{u}_{t}=\{i^{u}_{t,u_{i},u_{j},i}\mid u_{i},u_{j}\in U,t\in T_{i,u}\} \tag{3}\]  
\[I^{uc}_{t}=\{i^{uc}_{t,u_{i},u_{j},i}\mid u_{i}\in U,c_{j}\in C,t\in T_{i,uc}\} \tag{4}\]Relations (\(R\)) can link any two elements: two users (\(R^{u}\)), a user with content (\(R^{uc}\)), or two pieces of content (\(R^{c}\)).  
\[R\equiv\{r_{t}\mid t\in T_{r}\}=R^{u}\cup R^{uc}\cup R^{c} \tag{5}\]  
\[R^{u}_{t}=\{r^{u}_{t,u_{i},u_{j}}\mid u_{i},u_{j}\in U,u_{i}\
eq u_{j},t\in T_{ r,u}\} \tag{6}\]  
\[R^{uc}_{t}=\{r^{uc}_{t,u_{i},c_{j}}\mid u_{i}\in U,c_{j}\in C,t\in T_{r,uc}\} \tag{7}\]  
\[R^{c}_{t}=\{r^{c}_{t,c_{j},c_{j}}\mid c_{i},c_{j}\in C,c_{i}\
eq c_{j},t\in T _{r,c}\} \tag{8}\]  
where \(T_{a,b}\) are the types of elements \(A^{b}\), e.g., \(T_{i,uc}\) are the types of interactions between users and content (\(I^{uc}\)).  
From these definitions, it is obvious that interactions and relations are very similar, and a network of users and content can be created using either one or both of them. In the parts of the model where a relation (\(R\)) or an interaction (\(I\)) can be used, the term edge (\(E\)) can be used instead.  
There are countless ways to construct a social context for the piece of text, depending on the types of information included and how it is gathered. The richness of context influences the type of analysis that can be performed. For the sake of comparison, the ways in which social context is constructed and analyzed can be grouped into one of several categories, according to a taxonomy of approaches [1]. The categories are, from simpler to more complex: _micro_ approaches, in which only one user is included along with the content he or she created; _meso_ approaches, which also add other users and relations or interactions with them; and _macro_ approaches, which include information from outside the OSN, such as facts or encyclopedic knowledge. The _meso_ level is further divided: _meso_, only uses relations; _meso_ also includes interactions; and _meso_ adds information from social network analysis, such as partitions, modularity, or betweenness.