Full text
Title: Study of Microscopic Properties of Information Communities in Online Social Networks Author: Arnau Sanromà Mani Advisor: Peter Marbach Department: Computer Science Department, University of Toronto Co-Advisor: F. Javier Heredia Cervera Department: Departament d’Estadística i Investigació Operativa, UPC Academic year: 2016 - 2017 Degree in Mathematics
Universitat Politècnica de Catalunya Facultat de Matemàtiques i Estadística Bachelor’s Degree Thesis Study of Microscopic Properties of Information Communities in Online Social Networks Arnau Sanromà Mani Advisor: Peter Marbach1 Co-advisor: F. Javier Heredia Cervera2 1.Computer Science Department - University of Toronto 2.Departament d’Estadística i Investigació Operativa - UPC
The laws of history are as absolute as the laws of physics, and if the probabilities of error are greater, it is only because history does not deal with as many humans as physics does atoms, so that individual variations count for more. – Isaac Asimov, Foundation
Abstract Communities are a fundamental structure in social organizations. It is not surprising, then, that there have been multiple attempts at modeling them in order to better understand the architecture of our civilization. Usually, these models are based on online Social Networks, which provide incredibly valuable data about communities that are believed to be significantly similar to real-life communities. Large scale models have provided insight in several macroscopic properties of these networks. There is, however, very little work on the microscopic properties of communities and their role in Social Networks, leaving an important research gap that is being fulfilled during recent years.
Acknowledgements First of all, I would like to thank my advisor at the Computer Science Department of the University of Toronto, Peter Marbach. He has closely supervised this thesis and has devoted plenty of time to it. I am honored to have worked with him and I really appreciate his scientific support and kind hospitality during my stay in Toronto. I give thanks to Lisa De Caro and Bridgid McNulty for the administrative support that made possible this experience. I would also like to thank Javier Heredia, professor at the Universitat Politècnica de Catalunya, as the co-advisor of this thesis. Despite the long distance, he has provided support and helpful advice in moments of need. I must mention a special gratitude to all the new friends this experience has provided. Particularly to those who have been there in the good relaxing moments but also in the hard stressful ones. Thanks to Joakim, Talha, Kasia and Moosa for the kitchen talks and the amazing banana bread able to enlighten the darkest of days. Also to Sergio, Leks, Lucas and Remi for the companionship and the hosting in the best suite in Toronto. This experience would not have been the same without them. I am incredibly grateful to have been a part of the CFIS program during these four and-a-half years. Thanks to its directive and administrative team, not only for this opportunity at the University of Toronto, but also for the continued and personal support during all these years. I need to mention the incredible effort given by Miguel Ángel in the obtaining of my VISA. I feel privileged to have studied both at the FME and the ETSEIB, where I have created bonds I hope will last far beyond the academic environment. I cannot find the words to thank Ignasi and Carla as my companions during this stage of my life; during the last four years, I have certainly seen them more than my own family, and I now consider them part of it. I would not like to forget Xavi, whose help has been more than remarkable during my studies, and who I would like to thank for being a role model. Last but not least, I would like to mention my family for their encouragement and support. Thanks to my parents for being always there, my sister because. .. what would I do without her? And my grandmothers, for understanding my absence in the family events for six months. I express my most sincere gratitude to Emma, who despite the distance has been as close as always. Finally, to my dearest friends, Marc and Adrià, for their advice, council and support for more years than I can remember.
4 1. Introduction
2 Hypotheses This chapter provides hypotheses about possible properties and characteristics of Information Communities in Social Networks. These hypotheses are a direct result of the observation of communities both in real-life and in online Social Networks, together with logical reasoning. While being aware that logical arguments alone do not fully proof the hypotheses, we believe them to be strong enough to be worth studying. For every hypotheses, we provide reasons for why we believe it is true, explanations of what would happen if they were incorrect and a representation of where we can observe them in real life. 2.1 Existence The first hypothesis of this project goes to the very root of social organization, questioning something we usually assume and take for granted. However, we believe it is crucial for a good research to have a solid base in which to start, and that means trying not to assume anything we do not know for certain. 1 Hypothesis Communities exist. This hypothesis would not be useful without the proper definition of what do we mean by Communities and why we think this is most probably a true hypothesis. Hence, we define: 2.1.1 Definition (Community) A Community is a social group consistent of individuals and/or institutions that can be characterized together because they have something in common. In our case, this common thing that unites them will be a particular interest. We could say that a community is C={u∈U|uinterested in x} where Uis the space of users/individuals and xis the topic around which the community is formed. We strongly believe this hypothesis to be true, not only because all the previous work from different approaches (i.e. including psychology, sociology or graph theory) regarding communities; but because of the logical reasoning that makes us think a
6 2. Hypotheses world without communities would not make sense. Therefore, we now present the logical arguments that support this hypothesis. Everywhere in the world we can see people organized by common interests. From the fans of a football team to a tribe in the middle of the jungle. From an association of farmers to a religious group. We can see people being grouped together around almost every kind of interest. This certainly means that there are reasons why these gatherings, these communities, are formed. Communities provide a large amount of advantages to individuals and to society itself. Being part of a community, individuals get the opportunity to be aware of new and relevant information about a topic in which they are interested in as well as the chance to share their own knowledge and be heard by others. Society in general is also affected by the existence of the communities, they are basically a way to organize society. They provide a classification that helps society work efficiently because it unites individuals in groups where they will encourage each other and work better. Communities improve the progress within society in many topics, as people interested in one topic are provided with more information about that topic and can obtain new ideas. A world without communities, a society without communities, would most likely be disorganized. A place where people would have certain interests but could only share them with other people whose interests might be totally different. People would not be aware of most of the information generated about the topics they care about. A place where little progress could be made because the people researching in the same topics would not be in contact together so they could not use each other help or work. All this reasons make us believe that communities, as groups of people united by a common interest, really exist in our society. In the explanation and argumentation of the following hypotheses, we will additionally show how they are observed in real-life communities for a better understanding. Hence, in the next section we do not provide a new hypothesis but examples of real-life communities that will be used in later hypotheses. 2.2 Real-life Community Examples For each of these examples, the topic of interest around which the community is created will be explained. The different kind of members will be defined so that later on they can be used to exemplify different roles in the community. We want to clarify that the description of these communities is not meant to be exact but simple and easy to understand. 2.2.1 State Politics This community is focused around the politics of a specific country. The interest of this community would be to know political decisions taken by the government as well as other political information like the opinions of politicians, election polls, intentions
2.2. Real-life Community Examples 7 and ideals of different political parties, etc. A community like this has very different kinds of members. First of all, the politicians in the state government and the different parties. They are the main producers of information of the community. Secondly, there is the media, like politics newspapers and TV programs, who summarize the information and offer it to the public. Finally we have the regular citizens that are interested in politics. This last group can also be classified in smaller categories and its the most extensive. People interested in general politics that just want to know the main information. People involved enough to have an opinion and share it through social media or talks. People who actively follow a specific party and want to be more aware about the political moves of this particular party. This people can also just want the information or actively talk about it. We consider this community to be a large community. However, we also believe it contains smaller communities within itself. For example, every political party can be regarded as a unique community because it has its own particular interests and voters. 2.2.2 Climate Change When we talk about a Climate Change community, we are talking about the people and organizations that are concerned about the global warming and climate change, both if they take and action to fight it or not. The interest of the community goes from the scientific data that shows the effects of the climate change to the different ways of preventing it. It also includes future predictions about climate change and influences different political decisions would have on this phenomena among other things. Again, a community like this gives place to different kinds of members. Scientist studying possible effects of climate change. Temperature raise, sea ice loss, CO2emissions, etc. Organizations that try to show the problem to the people and offer ways to fight it. Regular people who are interested in climate change. However, there are different levels of involvement in this kind of members. We consider these to be the largest group of members. People concerned about the climate change who want to know the latest news. People who share their point of view on the topic, usually based on information obtained by higher members but also on their own thoughts.
8 2. Hypotheses Note that we do not consider to be in this community the people that talk about climate change but are against it, because they do not share an interest with this community. We also consider these community to enclose other communities about more specific aspects of the climate change: Arctic sea ice loss, rising temperatures, etc. Each of these could be regarded as a single community but they are clearly part of the larger community that is Climate Change. 2.2.3 Basketball in a small city We consider this community to be the group of people interested in basketball in a determined city. We remark that the topic of this community is the basketball played in the city, not the basketball professionally played around the country. So that would include basically people that like playing basketball and people that like watching others play. Therefore, the kinds of members of this community would be: The participants in the basketball games in the city. Such as players, coaches and referees. The people who go to see the games because they are interested in them. The basketball clubs of the city, the teams themselves. We are aware that this community is small and that maybe the majority of its members would share another interest for professional basketball. But the point of this example is to provide a narrow community. The purpose of this examples is to provide three very different communities in order to see if our hypotheses can be seen in all of them. The first two examples show communities that are large but are very different when it comes to the topic. On the other hand, the third example shows a smaller community with a very different topic, too. We hope these examples are clear and that they will be of use when used to clarify later points during the project. 2.3 Finding Considering the existence of communities to be true we now wonder about their characteristics. However, we do it step by step; thus this second hypothesis does not talk about their behavior or structure, but about finding them. 2 Hypothesis Communities are easy to find. When we say "find a community" we mean the process by which an individual identifies enough people that are interested in the topic to receive the main relevant information of the community. The fact that we can quickly identify groupings gathered by interests in our society makes us think that communities are easy to find. We can say that it is easy,
2.3. Finding 9 sometimes even intuitive, to find a group of people who share an interest. In addition, in our observation of online Social Networks we could clearly identify sets of users who posted about a common topic. Besides, what would be the point of having communities if they were difficult to find? Both individuals and existing communities benefit from the simplicity of finding communities. Individuals with particular concerns are positively influenced by the fact of being able to easily find people who share the same interests. This way they can invest their time in getting and producing information for the community rather than struggling to find it. Moreover, communities are themselves interested in being easy to find. Because then they can easily welcome new members and add potentially interesting information to the community. This simplicity also helps to avoid the creation of different communities around the same topic, which would lead to redundancy. This is due to the fact that probably no community will be created around an interest if another community already exists and is clearly identifiable. If communities were difficult to find, a lot of information would be lost because of individuals would be unable to find a community to share their information. Furthermore, as we said, different communities would be created around the same interest, unaware of their twin communities, giving way to redundancy. Basically, the progress in society would be slowed down and the satisfaction of the individuals would diminish. Despite these arguments, these hypothesis is pointless if we do not explain why are they easy to find and how to do it. We must ask ourselves what are the properties communities have that make them easy to find. As finding the communities is regarded as something somehow intuitive, we consider how we would find a community both in real life and in online Social Networks, and then try to identify the properties that have led us to find the community. We start with the real-life examples. 2.3.1 Example (Community finding for politics) For the politics community, if the individual looking for it had some knowledge about the politics in the country, it would most likely know some main information like who the president and main parties are. However, if the individual did not have any of these knowledge, because it was new to the country, for example, it would have to ask people for information. These people, as citizens of the country would probably be able to tell him this main information about the president and political parties. If not, at least, they could direct him to someone who knew or to, for example, the city hall of the city where the individual was. There the individual would surely find the necessary information about politics it needed. Note that we assume that when the individual became aware of the information shared by the president and the main parties (either by them or by political TV programs or newspapers), the search for the community would be over, because these members would provide the most important information in the politics community. 2.3.2 Example (Community finding for climate change) For the climate change community, it is reasonable that the individual knew about some climate change organizations if it had some knowledge about it. If it did not have knowledge of climate change at all, the individual would be again forced to interact with other people by asking them. It would likely not find the information about the main organizations concerned about climate change directly. Despite not getting this information, it
10 2. Hypotheses would probably be directed to someone with a little knowledge about this phenomena, or at least some knowledge of something related like, for example, recycling. A person concerned about recycling could lead the individual to the department in the city responsible for recycling or show him a website about why recycling is important. The department responsible for recycling in the city would most likely have information about why recycling es important and it would be related with climate change. From this point, the individual would have enough information to know about the different organizations concerned about climate change. Finding this organizations would mean to find the community as they would provide the main relevant information about the climate change effects and how to fight it. 2.3.3 Example (Community finding for basketball) At last, for the basketball community, if the individual had a slight knowledge about the basketball in the city, it would probably be able to locate some of the basketball fields. By going there, the individual would get to know the main city teams and be then aware of the main games and players in the league. If the individual was a newcomer and had not the faintest idea about the basketball in this particular city, it would have ask people for directions. If the individual asked around, in the best case, it would be directed to a club of the city or a basketball field. However, it would at least be directed to someone who played basketball or knew someone who did. From this point, the basketball player would lead the individual to the different basketball fields in the city and the main teams and clubs. Being aware of the city teams and basketball fields would provide the individual with the necessary information about basketball in the city. We would like to note that when interacting with other people, the different individuals would follow the directions of the people they found had given them the best information. We believe it is important that the quality of information is considered rather than following all directions without thinking if they are relevant or not. Regarding online Social Networks, when we were trying to find communities within them, we applied the following process. Note that this is a process particularly designed to find information communities in Twitter. First of all, the process is an iterative method that stops upon convergence. The first step of the process was always a user that showed a particular interest, sometimes among many others. From this user, the community around that particular interest was searched. In every iteration, the retweets made by the user where studied: if they had interesting information related with the desired topic, the original user who posted them was added to the group of users. After scrolling down a significant amount of time in the user timeline, all the added users were regarded one by one to see of they were really users concerned about the topic or if that tweet had been a coincidence. This way, the users in the group were "ranked" considering how interesting their tweets were, how frequently they posted and if they were focused in the topic. Then, the best users were picked and the process was repeated: going over these users’ timelines and analyzing the retweets. Every time, the group of users was deleted and replaced by the new added users. Eventually, and actually quite quickly, an iteration leaded to the very same group it came from, and then the process stopped. This group was a group of users who posted interesting information about the topic and where focused and used to retweet themselves. When following these final group of users we really felt like we had found the community and were receiving the most relevant information in it.
2.4. Cores 11 The descriptions of the processes to find communities both in real life and Twitter communities may seem very different, but we are interested in the general things they have in common. We can infer that, through considering the quality of the information received when interacting, users can follow a path of members that get better until the best users are reached. Due to the properties of this best users, finding them would basically be the same as finding the community. In the following sections we formalize the definition of this group of best users (Section 2.4) and how other users quickly lead to them by interacting and regarding information quality (Sections 2.5 and 2.6). 2.4 Cores In this section we formally define the group of distinguished members that we believe make communities easy to find. Although this hypothesis does not provide a full answer to this question, we consider it to provide other important information. 3 Hypothesis Information communities have a group of easily identifiable members that are focused on the community topic and provide the most interesting information about it. These members are related with each other. It is necessary to clarify what we mean by related with each other. The meaning of this relation is to observe that this members show a significantly higher connection than a group of random picked individuals would show. This can be regarded in different ways depending on the environment. For example, in real life we would mean that this members know each other personally, or that are aware of each others’ information about the common interest or even that they sometimes held events together. In an online Social Network, like Twitter, we would mean that this members follow each other, even retweet each other, and also that they have common followers – which would mean that they both post interesting information about the same topic. From now on, we define this particular members of the community as its Core. 2.4.1 Definition (Core of a community) The Core of a community is a group of easily identifiable members who are focused on the community topic, provide the most interesting information about it and show a relation between them. We thought of this hypothesis because of our observation of information communities in online Social Networks but also because of what we can see in communities in real life. In Social Networks we could see, for every community we observed, that there was a group of users who were focused on the community topic. And a notable amount of users who we found were interested in the topic, followed them and sometimes even retweeted them. On the other hand, in real life we can constantly see this kind of core users in communities. We might call them differently, maybe popular or famous, but they clearly seem to be there. Let’s see how this core would be interpreted in our three examples. 2.4.2 Example (Core of a community for politics) For the politics community, the core would be formed by the main politics of each party – the ones who held the
12 2. Hypotheses majority of events and speeches — as well as the politic TV programs and newspapers who summarize and share the political information of the country. These members are the ones who provide the more relevant information of the community, and they are easily identifiable. Moreover, they are related meaning that the politicians are aware of each other opinion and the media is aware of all the politicians and political moves. 2.4.3 Example (Core of a community for climate change) Considering the climate change community, the core members would be the organizations that gather and share the information from the scientists and inform the people about climate change. Maybe some scientist could be part of this group if they were focused on climate change data and made their work public frequently. These members would provide the best information about climate change. They would be also related with each other because these organizations would have to be aware of the scientist work and of other organizations in order to provide the best information. 2.4.4 Example (Core of a community for basketball) Finally, for the basketball community it is different but we still can identify a core. The core for this community would be the teams and clubs in the city, who would have the information about all the games and most players of the city. They would be easily identifiable within the city and would be related because the teams would be aware of each other in order to know their opponents. Individuals, core members, and communities are favored by the existence of this cores. Cores help individuals to find and identify communities, because they are users that are focused on the topic – and users that are focused are easier to locate than users that talk about many different topics. Individuals also benefit from the importance of the information offered by these members. Cores serve communities by making them easy to find but also by providing information that improves the quality of the community. Finally, core members, by being focused on one topic and providing interesting information, are rewarded by other users with popularity. We could think of this as a cycle. The more interesting and focused a user is, the more easy to find and the more individuals will follow him. The more individuals follow, the more popular the user is. And to maintain and increase this popularity, the user will have to become more interesting and focused. In case that communities in society did not have a group of core members as we defined several things would happen. First of all, without the cores, communities would be more difficult to find. This is because users that are focused and provide interesting information are easy to find. On the other hand, users that have many interest are difficult to spot as members of the community of one of those interests. For the same reason, the fact that core users post relevant information makes them easier to find that individuals who do not. Finally, if there was a group of members who were focused and posted interesting information but were not related between themselves, it would not make sense either. If they were not related in any way, they would not be aware of each other contributions to the community and that would again lead to redundancy. In addition, it is nothing but logical that in order to provide relevant information for a community, a member has to be aware of the relevant information offered by other members.
2.5. Ranking 13 We firmly believe this hypothesis to be true. However, we also suspect that the core of a community has other functions and properties we have not mentioned and this leads us to come up with new ideas and hypotheses explained in Section 2.7. Finally, we note that although they are helpful, cores are not enough for communities to be easy to find. If communities were formed only by their cores, they would not be easy to find. That would mean that nobody would know anything about the community except for the reduced group of core members. Therefore, an individual who wanted to find the community would have a difficult time because it would have to find one a core user directly without help from other individuals. This shows that the presence of a core within a community is not enough to make it easy to find. Hence, we need to determine what other properties communities have that make it possible. This will be discussed in the following Sections 2.5 and 2.6. 2.5 Ranking Now that we have defined what the core of a community is and we believe that communities are easy to find, we explain why is it easy. As mentioned in Section 2.3, once the core is identified, the search is done. Because the most important information is provided by the core and it is connected to the rest of the community. Hence, we can regard the core like the goal to the search and not the process. As we consider communities to be easy to find, we should see that from every starting point, it is easy to get to the core. Therefore, we have to study the structure of the path between the starting points and the core. As the goal of this search is to find the best information available in the community, we find it necessary to be able to evaluate this information. Actually, we believe it is important to evaluate the individuals by considering, among others, the quality of the information they provide. Hence, we define a function to do it. 2.5.1 Definition (Rank) Let Ube a space of users (or individuals). For every topic xwe define Rx(u)as the rank the user u∈Uhas referring to the topic x. The higher the rank, the better the user is for the community around x. This function gives place to the following hypothesis. 4 Hypothesis Members of a community around a particular topic xcan apply the function Rx(·)to a user through interacting with it. Despite calling it Rx(·)in both cases, we believe there is a difference between applying it in real life or doing it in online Social Networks. In real life, the interaction would be a conversation; in online Social Networks the interaction would be the examination of a user timeline. During a conversation with an individual, the person receiving the information can only judge (rank) the quality of this information. On the other hand, when looking at a user timeline, an individual can use three main things to rank: quality, frequency and focus. By quality of information we mean that the information is relevant for the community. Basically, that the information is true, reliable and adds something new to the community. The frequency is simply the rate at which
20 2. Hypotheses
3 Model for information communities The aim of this chapter is to expound an existing mathematical model for information communities [5]. The main properties will be explained and some results will be proved. The goal is to relate the hypotheses we have described for information communities with this model. Not only relating the properties and definitions of the model with the ideas reflected in the hypotheses; but also proposing possible extensions of the model to cover the concepts in the hypotheses. This model understands information communities to be part of information networks, which are defined as networks where agents (individuals) share and exchange information. It assumes, first of all, that all the content that is being shared is being produced by agents in the network. Moreover, it is also assumed that different agents have different capacities for producing and consuming content. With this configuration, it considers the situation where agents form communities with the purpose of sharing and exchanging information. The situation is formally modeled through utility functions that capture the benefit agents obtain from being members of a particular community. Two utility functions are defined, one for information production and one for consumption. The main questions this model aims to answer are: What is the community structure that emerges under this model. What is the content that individual agents will produce in a community. How is content being filtered and distributed within a community. The proposed model is simple enough to allow a formal analysis. In particular, it uses a game-theoretic framework to characterize the community structure that emerges under a Nash equilibrium. Although its simplicity, the model provides interesting results on, for example, how content is being produced, that match what has been experimentally observed in real-life social networks. Another interesting result is that the model suggests a connection between content filtering, influence, reputation and identity in information communities, which are concepts mentioned in the hypotheses. An although is only preliminary, it offers the possibility to formally study these concepts further.
22 3. Model for information communities 3.1 Mathematical Model The model studies the situation in which agents are interested in different content and have different abilities to produce it. This section describes the space of contents, the interest of agents in content and the ability to produce it, and finally the utility functions associated to being part of a community. 3.1.1 Content Space. Production and Consumption The model considers the space of content types to be a metric space Γ. And characterizes each content item by its type x, such that x∈Γ. To simplify the analysis, it is assumed that Γis a one-dimensional metric space. Γis given by an interval [−L, L)∈R, and the distance between two content types x, y is provided by the following metric d(x, y) = ||x−y|| = min{|x−y|,2L− |x−y|}, where |x|defines the absolute value of x. This is, indeed, a metric because 1) Clearly d(x, y)≥0and d(x, y)=0⇔x=y 2) d(x, y) = d(y, x)since |x−y|=|y−x| 3) d(x, y)≤d(x, z) + d(z, y) The last property is not trivial. However, if we use that |x−y| ≤ |x−z|+|z−y|and try to interpret the metric, we see that it is equivalent to joining the points −Land Lto form a circle. Then if two points in the circle are closer to each other through the path that crosses the joint point, then this is the distance that is picked. This can be better understood looking at the following descriptive figure. Figure 3.1: Interpretation of the used metric. The length of the blue segment would be the result of ||x−y|| The reason why the model uses this metric is that it provides the advantages of a one-dimensional metric without having the problem of the boundary points. From now on, only the notation ||x−y|| is used for the metric.
3.1. Mathematical Model 23 It is assumed that different agents are interested in different content types and also have different abilities to produce content. To model this situation, each agent is considered to have a center of interest y∈Γ. As an abuse on notation, agents will be referred by the content type of their center of interest y. Then, it defines the interest of agent y∈Γin content of type x∈Γas p(x|y) = f(||x−y||), where fis a non-increasing function. The meaning of p(x|y)is that if agent yconsumes content of type x, then it finds it interesting with probability p(x|y). On the other hand, it defines the ability of agent y∈Γto produce content of type x∈Γas q(x|y) = g(||x−y||), where, again, gis a non-increasing function. The interpretation is that if agent y produces content of type x, the content will be relevant to the content type x∈Γ with probability q(x|y). For both functions fand g, the following assumption is made. 3 Assumption The function f: [0, L)7→ [0,1] is strictly decreasing and twice differentiable. The function g: [0, L)7→ [0,1] is strictly decreasing, concave and twice differentiable on its support supp(g) = {t∈[0, L)|g(t)6= 0}. This assumption represents the intuition that individuals that are more interested in content types that are close to their center of interest. Moreover, this agents also have a better ability to produce relevant information about content types similar or close to their center of interest. Let µ(y)be the density function that characterizes the distribution of agents in Γ. To simplify the analysis, it is from now on assumed that this distribution is uniform along Γ. Therefore, it results that µ(y)dy =dy, y ∈Γ. 3.1.2 Communities and Utility Rates Information communities are modeled as follows. 3.1.1 Definition (Information Community) Each information community C= (Cc, Cp)is defined by a set Cc⊆Γof agents that consume information, and a set Cp⊆Γof agents that produce information. It is assumed that all agents in Cchave access to content produced by agents in Cp. Obviously, agents can be both in Ccand Cpat the same time. This assumption differs from the hypotheses and from social networks like Twitter. However, it is made for simplicity and still lets the model come up with interesting results. For a given community C= (Cc, Cp), each agent y∈Cpis assumed to be able to decide the dedication it allocates in producing content of type x∈Γ. Then, let βC(x|y)be the rate at which the agent y∈Cpproduces content of type x∈Γ in community C. As the function βC(·|y)can be understood as an effort, it is a non-negative function: βC(·|y)≥0for x∈Γ, y ∈Cp.
24 3. Model for information communities 3.1.2 Definition (Total Production Rate) The total production rate for type x∈Γin the community Cis the rate at which xis produced in Cover all agents y∈Cp. It is given by βC(x) = Zy∈Cp βC(x|y)dy. As the content type x∈Γgenerated by y∈Cpis only relevant to xwith probability q(x|y), the previous total rate can be refined to create the following rate. 3.1.3 Definition (Content Supply Function) The content supply function of community C,QC(·), is the total rate at which relevant content of a given type is produced in C. It is given by QC(x) = Zy∈Cp βC(x|y)q(x|y)dy. Now, for content consumption, each agent y∈Ccis assumed to be able to decide the effort invested in consuming content in community C. Let αC(y)be the rate at which agent yreads content produced in community C. Again, we have that αC(y)≥0for y∈Cc. Recall that when each agent y∈Ccconsumes content of type x, it finds it interesting with probability p(x|y). Consequently, the content demand function of C can be defined. 3.1.4 Definition (Content Demand Function) The content demand function of community C,PC(·)provides the demand of content xin Cover all agents y∈Cc. It is given by PC(x) = Zy∈Cc αC(y)p(x|y)dy. It is crucial to see why αC(y), differently from βC(x|y), does not depend on the content type. This is because the effort yputs in reading information from community Cdoes not depend in the content type of the information produced. Therefore, PC(x)does not depend on the rate at which xis being produced, only on the interest agents y∈Ccshow in the content type x. With the purpose of defining utility rates, it is assumed that agents pay a cost cfor consuming a content item. creflects the effort and time required by an agent to read the content item and decide if It finds it interesting or not. As a reward, it is assumed that if the agent finds the content item interesting, it receives a reward equal to 1; if not, it receives a reward equal to 0. Using the previous definitions and functions, it is clear that the rate at which an agent y∈Ccreceives information of type xin C that is of interest to yis given by αC(y)QC(x)p(x|y). On the other hand, the rate at which yreads content of type xin Cfor which it pays a cost cis αC(y)βC(x)c The combination of these to results, computing a “reward minus cost”, leads to the utility rate for content consumption.
3.1. Mathematical Model 25 3.1.5 Definition (Utility Rate for Content Consumption) The utility rate for content consumption of agent y∈Ccin community C,U(c) Cis given by U(c) C(y) = Zx∈Γ αC(y)QC(x)p(x|y)−αC(y)βC(x)cdx = αC(y)Zx∈Γ [QC(x)p(x|y)−βC(x)c]dx For the utility rate, the interpretation of its cost and reward is explained after it is defined. 3.1.6 Definition (Utility Rate for Content Production) The utility rate for content production of agent y∈Cpin community C,U(p) Cis given by U(p) C(y) = Zx∈Γ βC(x|y)Zz∈Cc αC(z) [q(x|y)p(x|z)−c]dzdx = Zx∈Γ βC(x|y) [q(x|y)PC(x)−αCc]dx. The interpretation of this rate is as follows. [q(x|y)p(x|z)−c]is the expected reward that agent z∈Ccobtains from content of type xthat is being produced by agent y∈Cs. Therefore, one can think of [q(x|y)p(x|z)−c]as the amount agent zis willing to pay agent yfor obtaining content of type xfrom y. Therefore, the utility rate for content production of yreflects the revenue ywould obtain from producing content in community C. This rate can also be regarded as the "reputation score" of agent y in community C; the higher the rate, the more beneficial contributions from agent y are for community C. An interesting aspect of this model is that total utility rates for content production and consumption are the same, this is Zy∈Cc U(c) C(y)dy =Zy∈Cp U(p) C(y)dy =Zx∈Γ PC(x)QC(x)dx−αCβCc, where αC=Zy∈Cc αC(y)dy, βC=Zx∈Γ βC(x)dx. 1 Proof For the total utility rate for content production we have: Zy∈Cc U(c) C(y)dy =Zy∈CcZx∈Γ [αC(y)QC(x)p(x|y)−αC(y)βC(x)c]dxdy As it is the same to integrate over all content types x∈Γfor every y∈Ccthan to integrate over all agents y∈Ccfor every x∈Γ, we can swap the two integrals. Then, we have: Zy∈CcZx∈Γ [αC(y)QC(x)p(x|y)−αC(y)βC(x)c]dxdy = Zx∈ΓZy∈Cc [αC(y)QC(x)p(x|y)−αC(y)βC(x)c]dydx = Zx∈ΓZy∈Cc αC(y)QC(x)p(x|y)dydx −Zx∈ΓZy∈Cc αC(y)βC(x)cdydx
26 3. Model for information communities Now, using that PC(x) = Ry∈CcαC(y)p(x|y)and αC=Ry∈CcαC(y)dy we can continue Zx∈ΓZy∈Cc αC(y)QC(x)p(x|y)dydx −Zx∈ΓZy∈Cc αC(y)βC(x)cdydx = Zx∈Γ QC(x)PC(x)dx −Zx∈Γ αCβC(x)cdx =Zx∈Γ PC(x)QC(x)dx−αCβCc since βC=Rx∈ΓβC(x)dx. On the other hand, for the total utility rate for content production we have: Zy∈Cp U(p) C(y)dy =Zy∈CpZx∈Γ βC(x|y)Zz∈Cc αC(z) [q(x|y)p(x|z)−c]dzdxdy = Zy∈CpZx∈Γ βC(x|y)Zz∈Cc αC(z)q(x|y)p(x|z)dz −Zz∈Cc αC(z)cdzdxdy Again, we can swap the two integrals and we obtain the following expression and we use that PC(x) = Ry∈CcαC(y)p(x|y)and αC=Ry∈CcαC(y)dy, Zx∈ΓZy∈Cp βC(x|y) [q(x|y)PC(x)−αCc]dydx = Zx∈Γ Zy∈Cp βC(x|y)q(x|y)PC(x)−Zy∈Cp βC(x|y)αCcdy!dx Finally, using that QC(x) = Ry∈CpβC(x|y)q(x|y)dy and βC(x) = Ry∈CpβC(x|y)dy the expression becomes: Zx∈Γ QC(x)PC(x)dx −Zx∈Γ βC(x)αCcdx =Zx∈Γ PC(x)QC(x)dx−αCβCc and the result follows since βC=Rx∈ΓβC(x)dx. 2 3.2 Community Structure In order to study how agents maximize their utility rates forming communities, the concept of community structure is defined using the model described. 3.2.1 Definition (Community Structure) A Community Structure is a triplet (Ω,{αΩ(y)}y∈Γ,{βΩ(·|y)}y∈Γ)where Ωis a set of communities Cas previously defined and αΩ(y) = {αC(y)}C∈Ω, βΩ(·|y) = {βC(·|y)}C∈Ω are the consumption and production rates that agents have in the different communities C= (Cc, Cp)∈Ω
3.2. Community Structure 27 This model characterizes the community structure that arises under a Nash equilibrium. In game theory, a Nash equilibrium [6] is a strategy profile in which no player can benefit by unilaterally changing its strategy. The reason to study this kind of strategy profiles is the believe that real-life social networks are optimal and it is tried to model them as so. 3.2.2 Definition (Nash Equilibrium) Let (N, S, b)be a game with |N|=nplayers where Siis the strategy set for player i∈N,S=S1×S2× · · · × Snis the set of strategy profiles and b(x) = (b1(x), b2(x), . . . , bn(x)) is the benefit function for a given strategy profile x∈S. Let xibe the strategy of player i∈Nand x−ithe strategy of all the other players. Then, if player iselects strategy xiwhich originates the strategy profile x= (x1, x2, . . . , xn)∈S, it gets a benefit of bi(x). A Nash equilibrium is a strategy profile x∗∈Ssuch that ∀i, ∀xi∈Si, bi(x∗ i, x∗ −i)≥bi(xi, x∗ −i) i.e. No player benefits from changing its own strategy if the others remain the same. Before adapting this definition to the model, it is required that for a given community structure (Ω,{αΩ(y)}y∈Γ,{βΩ(·|y)}y∈Γ)and for C= (Cc, Cp)∈Ω αC(y)>0, y ∈Ccand Zx∈Γ βC(x|y)dx > 0, y ∈Cp, which basically means that each agent y∈Cchas a positive consumption rate in community Cand each agent y∈Cphas a positive total production rate in community C. It is also assumed that the total content consumption and productions rates for each agent yare bounded by a threshold. This mainly reflects the idea that an agent does not have an infinite amount of time to dedicate to content production and consumption. Therefore, for each agent ||αΩ(y)|| =X C∈Ω αC(y)≤Ec, y ∈ {y| ∃C∈Ω, y ∈Cc}, and ||βΩ(·|y)|| =X C∈Ω ||βC(·|y)|| ≤ Ep, y ∈ {y| ∃C∈Ω, y ∈Cp}, where ||βC(·|y)|| =Zx∈Γ βC(x|y)dx Note that the norm used here is defined differently than the distance used in the space of content types Γ. Finally, a community structure (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ)is called a Nash equilibrium if for each agent yit is true that α∗ Ω(y) = arg max αΩ(y):||αΩ(y)||≤EcX C∈Ω αC(y)Zx∈Γ [QC(x)p(x|y)−βC(x)c]dx and β∗ Ω(·|y) = arg max βΩ(·|y):||βΩ(·|y)||≤EpX C∈ΩZx∈Γ βC(x|y) [q(x|y)PC(x)−αCc]dx.
28 3. Model for information communities This conditions basically reflect that on a Nash equilibrium each agent maximizes its own utility rate. A Nash equilibrium is called a covering Nash equilibrium if {y| ∃C∈Ω, y ∈Cc}={y| ∃C∈Ω, y ∈Cp}= Γ Which means that the each agent is a a content consumer and producer in at least one community. The main result of this model is on Nash equilibria. To formulate it, the following definition is necessary. Given an interval I⊆Γof length ||I||, the mid-point (average) of the interval Iis mid(I) = 1 ||I|| Zx∈I xdx. Using the model and structure defined above, it is possible to present the following result. 3.2.3 Proposition If f(0)g(0) −c≥0, then there always exists a covering Nash equilibrium (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ) such that for each community C= (Cc, Cp)∈Ω∗we have that Cc=Cp=IC, where {IC}C∈Ω∗is a set of mutually non-overlapping intervals of equal length, and for each community C= (IC, IC)∈Ω∗we have that 1) α∗ C(y) = Ec, y ∈IC, and each agent y∈Γconsumes content in exactly one community. 2) β∗ C(·|y) = Epδ(x∗ y−x), y ∈IC, where x∗ y= arg max x∈Γ q(x|y)PIC(x), and δis the Dirac delta function. 3) PC(x)is strictly concave on ICwith mic(IC) = arg max x∈Γ PC(x) and a support supp(PC)such that IC⊆supp(PC). Furthermore, we have that PC(x)is symmetric around y0=mid(IC). 4) Q∗ C(x)given by Q∗ C(x) = Zy∈IC Epδ(x∗ y−x)q(x|y)dy, is strictly concave on the support supp(Q∗ C(x), with supp(Q∗ C(x) = I∗ C⊆IC and mid(IC) = arg maxx∈ΓQ∗ C(x). Furthermore, we have that Q∗ C(x)is symmetric around y0=mid(IC).
3.2. Community Structure 29 5) We have that mid(IC) = arg max y∈IC U(c) C(y) = arg max y∈IC U(p) C(y). This result states that there always exists a covering Nash equilibrium (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ) with a simple structure that can be interpreted has follows. There is a set {IC}C∈Ω∗of mutually non-overlapping intervals of equal length, such that each interval ICdefines a community C= (Cc=IC, Cp=IC). Each community C= (Cc, Cp)∈Ω∗the set of content producers and consumers are identical and equal to IC. Each agent y∈Γbelongs to exactly one community, and each content producer focuses on producing exactly one type of content x∗ y. This particular type does not maximize the individual rate for all agents; instead, it considers the interests of the whole community. The center agent y0=mid(IC)obtains the largest utility for content consumption and production in community C= (IC, IC), i.e. the agent y0benefits the most from being in community C. This proposition captures the idea that each content producer is focused on generating exactly one type of content, which is an interesting result as it has been observed in real-life social networks. It also reflects the fact that communities are created around one main topic, which is how information communities have been defined in our hypotheses. This topic is mid(IC)and as the result shows is the most demanded and produced topic of the community. It is also interesting how the result suggests that content producers generate a topic that is not their center of interest but a topic that is closer to the center of interest of the community: x∗ y6=y. The article with this model is presented suggests it would be interesting to check if this predicted behavior is actually detected in real-life communities. Although some of the results of Proposition 3.2.3 are too strict to be observed in real life, like the symmetry of P∗ C(x)and Q∗ C(x), it still captures interesting properties of information communities. We can see for example the importance of the agent(s) in the "middle" of the community mid(IC)which can be associated with the core defined in our hypotheses, because they produce the content which is more interesting to the community. 2 Proof The proof of this main result involves 16 Lemmas and 3 more Propositions. All the details of the proof of this result can be found in [5]. In this report we provide the proof of only two of the points of this result. 1) Given a community structure (Ω,{αΩ(y)}y∈Γ,{βΩ(·|y)}y∈Γ)and a content consumer ywe want to proof that the rate for content consumption α∗ C(y) = Ec, C =C∗ y 0, otherwise
36 3. Model for information communities First of all, recall that the total utility rate for content consumption and production over all agents without filtering are the same and given by Zx∈Γ [PC(x)QC(x)−βC(x)αCc]dx. Since in this situation all the content that is being produced is first being filtered by a particular agent yfand we are under the condition of Proposition 3.2.3, the total utility rate can be rewritten as Zx∈Γ r(x|yf) (Q∗ C(x)PC(x)−βC(x)αCc)dx. Using this expression, the next result can be formulated. 3.3.1 Proposition Let (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ)be a covering Nash equilibrium as given by Proposition 3.2.3 and let {IC}C∈Ω∗be the set of intervals that define the communities, i.e. we have that c= (IC, IC), C ∈Ω∗. Given an interval IC, we have that y0= arg max y∈ICZx∈Γ r(x|yf) (Q∗ C(x)PC(x)−βC(x)αCc)dx, where y0=mid(IC). This result affirms that the optimal agent to do the content filtering for the community is the central agent. Recall that we mentioned that the central agent could be associated with the idea of core users we introduced in our hypotheses. Therefore, this result reflects the idea in Hypothesis 6 that the core of the community performs the content filtering for all the community. 4 Proof A scheme of the proof for this result is shown below. The complete and detailed proof can be found in [5]. 1st step Reduce the result to two smaller results: First of all, without loss of generality, it can be assumed that IC= [−∆,∆],∆>0. In addition, from the proof of Proposition 3.2.3, we can extract that supp(Q∗ C) = I∗ C= [−∆∗,∆∗]⊆IC and that Q∗ Cis symmetric with respect to mid(IC). Now, the idea is basically to see that to proof this proposition is enough to proof that y0=mid(IC) = arg max y∈I∗ CZx∈I∗ C r(x|y)dx (3.2) and y0=mid(IC) = arg max y∈I∗ CZx∈I∗ C r(x|y)Q∗ C(x)PC(x)dx. (3.3) 2nd step Proof Equation 3.2:
3.3. Content Filtering 37 The way to proof this expression is evaluating d dy Zx∈I∗ C r(x|y)dx using the substitution s=x−y. This evaluation is done in different intervals depending on how the supp(r(x|y)) and the supp(Q∗ C(x)) intersect with each other. 3rd step Proof Equation 3.3: The way to proof this expression is also evaluating d dy Zx∈I∗ C r(x|y)dx using the substitution s=x−y. This evaluation is again done in different intervals depending on how the supp(r(x|y)) and the supp(Q∗ C(x)) intersect with each other. 2 Using that the optimal agent to do the content filtering is y0, in the following it is studied which is the optimal filtering function r∗(·|y0)the optimal agent should use. In order to maximize the total utility rate for content consumption and production over all agents. There is the following result. 3.3.2 Proposition Let (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ)be a covering Nash equilibrium as given by Proposition 3.2.3 and let {IC}C∈Ω∗be the set of intervals that define the communities, i.e. we have that C= (IC, IC), C ∈Ω∗. Given an interval IC, let t0= min{p(x|y0)|x∈supp(Q∗ C)}. Then the filtering function given by r∗(x|y0) = 1, if p(x|y0)≥t0 0, otherwise is optimal in the sense that r(·|y) = arg max r(·|y)Zx∈I r(x|y0) (Q∗ C(x)PC(x)−βC(x)αCc)dx. Furthermore, the total utility rates for content consumption and production over all agents under this filtering function is Zx∈Γ Q∗ C(x)PC(x)dx−αCβCc. This proposition is interesting because it shows that a simple threshold filtering function applied by the central agent y0leads to the same total utility rate as the one obtained without filtering.
38 3. Model for information communities 5 Proof This proof has also been changed from the original one in [5]. Mainly, to make it more clear. As (Ω∗,{α∗ Ω(y)}y∈Γ,{β∗ Ω(·|y)}y∈Γ)is a covering Nash equilibrium, note that we have that for y∈ICthat U(c) C(y)≥0and U(p) C(y)≥0. Particularly, if we use the definition of U(p) C(y), we can rewrite it as follows. U(p) C(y) = Zx∈Γ βC(x|y)[q(x|y)PC(x)−αCc]dx =1 Ep[q(∗ y|y)PC(x∗ y)−αCc] = Ep[g(||x∗ y−y||)PC(x∗ y)−αCc] Where the step 1has used that βC(x|y) = Epδ(x∗ y−y)and, therefore, in the integral over all Γonly the term where x=x∗ yis not zero. At the same time, and using similar steps, if we rewrite the term inside of the integral of the total utility rate overall agents we obtain: PC(x)Q∗ C(x)−βC(x)αCc= PC(x)Zy∈IC Epδ(x∗ y−y)q(x|y)dy −αCcZy∈IC Epδ(x∗ y−y)dx = PC(x)Epg(||x−y||)−EpαCc=Ep[g(||x−y||)PC(x)−αCc] Where, in this last expression, yis such that x∗ y=x. Therefore, we see that both expressions are basically the same. Now, using these expression and the fact that U(p) C(y)≥0, we have that PC(x)Q∗ C(x)−βC(x)αCc≥0. In addition, we can say that PC(x)Q∗ C(x)−βC(x)αCc= 0 if x6∈ supp(Q∗ C) because the expression can not be negative and αCβC(x)c≥0. Then it follows that for A⊆Γsuch that supp(Q∗ C)⊆A, the function r(x|y0) = 1, if x ∈A 0, otherwise is an optimal filtering function with a total utility rate given by Zx∈Γ Q∗ C(x)PC(x)dx−αCβCc. Note that this is true because in the expression Zx∈Γ r(x|y0) (Q∗ C(x)PC(x)−βC(x)αCc)dx, when r(x|y0) = 0 it does not affect the result because it means that x6∈ supp(r(·|y)) and therefore x6∈ supp(Q∗ C)and Q∗ C(x)PC(x)−βC(x)αCc= 0.
3.4. Observations 39 Finally, for the r∗(x|y0)defined in the proposition, we have just have to show that supp(Q∗ C)⊆supp(r∗(·|y0)) and the result will follow. We have that supp(r∗(·|y0)) = {x|p(x|y0)≥t0} where t0= min p(x|y0)|x∈supp(Q∗ C). Therefore, x∈supp(Q∗ C)⇒p(x|y0)≥t0⇒x∈supp(r∗(·|y0)) ⇒supp(Q∗ C)⊆supp(r∗(·|y0)) 2 3.4 Observations The proposed mathematical model is simple enough to offer the possibility of a formal analysis. In addition, as seen in Section 3.3 it can potentially be extended for further study of information communities. It needs to be said that the model also has its limitations and fails to capture some of the properties of information communities. For example, the overlapping structure of communities in real-life. One of the reasons to explain this problem could be the fact that the space of content types has been simplified to a one-dimensional metric space or that the distribution of agents has been considered uniform. As for the relation of this model with the hypotheses presented in Chapter 2 we have several connections. For the first hypotheses about the existence (1) communities, the model simply assumes that communities exist referring to their clear existence in real life and online Social Networks. About the finding of communities (Hypothesis 2), the model does not consider it in its development. However, it is interesting to mention that in [5] the question about how to find communities is suggested as a future research topic. In addition, it says that a possible approach would be that the central agents mid(IC)act as a label for the community, to make it identifiable. This is highly related to our finding hypothesis in which it is stated that the core of the community plays a crucial role for the finding of communities. Recall, that we can associate the central agents in the model with the core defined in Chapter 2. This supports the hypothesis that considers communities to have a core (3). For the ranking hypothesis (4), it is not said explicitly in the model, but it considers each agent to be able to decide whether the information produced by another agent is relevant or not. This could be understood as a ranking, the more relevant agent yfinds the information produced by agent z, the higher rank ywill associate to z. Still, this is not exactly the same as our hypothesis since we defined a ranking that would not completely depend on the agent who did it. Although it would be logical to think that agents in the same community with similar interests would come up with a similar ranking.
40 3. Model for information communities Hypothesis 5 talks about a structure that considers every agent to be connected to a better agent within the community. In the model, every agent is assumed to receive information from every other agent in the community, with no specific connections, which makes this structure not applicable in this case. Nonetheless, when talking about filtering, the model suggest a situation in which each agent is connected to the central agent (which is associated with the core). These circumstances would meet the structure from our hypothesis since the agents from the core are the best agents of the community. A situation in which every member of the community was connected only with the core, would be a an exaggeration of our hypothesis. Finally, for Hypothesis 6 about filtering, we have already seen how the model is related to it. It considers the central agents the most convenient to perform the content filtering for all the community. This is basically the same as our hypothesis suggests: that the core members are the ones that conduct the content filtering. About how the filtering is done, we did not define in our hypothesis how the core does it. However, we believe it to be something more complex than just a threshold as suggested in the model. It is a very interesting topic of future research to try to determine how exactly the filtering is done by the core members of an information community. Overall, we can say that the majority of the hypotheses are one way or another considered in this model. This is a simple model that offers a good way to represent them for further research and analysis.
4 Experiments The aim of this section of the project is to propose experiments that help us understand the validity of our hypotheses in Chapter 2. This experiments will be done in particular communities, particular topics, using Twitter information. We are totally aware that the observation of behaviors supporting our hypotheses in these experiments is not enough for us to be sure that the hypotheses are absolutely true. However, with the logic arguments presented with the hypotheses, we strongly believe them to be accurate, and this small experiments will be used to see if there is something clearly wrong with them. If these experiments are a success, together with the reasons presented with the description of the hypotheses, it will be a strong indication that the hypotheses are indeed true. First of all we will explain how we have obtained and treated the data. Then, we will continue by explaining the experiments, what is their purpose and how they are going to be realized. Finally, the results of the experiments, together with the proper conclusions, will be presented. We clarify that the data will be obtained both by the Twitter user interface and a Python package called tweepy [4] which is a wrapper for the Twitter API [9]. In order to use it, Twitter requires and OAuth authentication protocol which is free to access and easy to obtain by creating a personal Twitter Application and asking for the correspondent authentication tokens. The tweepy package offers access to both the Twitter API and the Streaming API, which allows real-time interaction with Twitter data. On the other hand, Twitter does not allow indefinite data download and has rate limitations. This rate limitations depend on the particular queries demanded and are important because surpassing them might cause penalization and suspension. In addition, there are other errors that can occur when downloading the data. The appendices of this project will include some of the most relevant codes used to download and treat data. 4.1 Download Data In this section we explain how we have downloaded the data from Twitter and what kind of data it is.
42 4. Experiments 4.1.1 Streaming Tweets Twitter offers access to the so called Streaming API. This API provides access to Twitter information being created in real time. For example, one can launch the connection and get all the tweets that are created by a specific user or that contain some particular keywords. Another interesting feature is the sampling of tweets. It allows you to gather random tweets that are being posted, which provides a good random sample of the information that is being generated in the whole network. Each tweet has a complex structure that contains a lot of information: the text, the date it was created, the author, location, hashtags, mentions, etc. To store all this information would require a lot of disk memory; hence, we created a reduced version of a tweet with less information. We used this simpler form both to stream tweets and also to get existing ones, and it contained: the ID number of the tweet, the text, the authors name, the date and time it was created, the number of retweets it has (not used when streaming) and, if it is a retweet, the ID number of the original tweet. Thanks to this adaption, we reduced the size of the downloaded tweets approximately 25 times. 4.1.2 Followers and Friends In the Twitter background, the users that follow a particular user are its followers, and the users this user follows are its friends. In several cases we have had to download the followers or friends of users. To do it, the Twitter API offers a simple function to ask for the followers or friends of a user. However, this functions are rate limited: one can only do 15 queries that provide a maximum of 5000 followers or friends each every 15 minutes. The queries for followers and friends are independent. This means that we can obtain a maximum 75000 followers and 75000 friends every 15 minutes. If a user has, for example, 6000 followers, it takes two queries to obtain all of them, which means the second query just provides 1000 followers. 4.1.3 Timelines The timeline of a user is the set of all tweets and retweets of the said user ordered by posting date. The function offered by the Twitter API to obtain a user’s timeline has two limitations. One can do 900 queries that retrieve a maximum of 20 tweets each every 15 minutes. Again, if a user has for example 25 tweets, two queries will be used and the second one will only provide 5 tweets. In addition, the maximum number of tweets that can be obtained from a specific user is 3200. That means that we can only obtain the newest 3200 tweets for every user (counting retweets). We believe this amount to be high enough to consider it representative of all the tweets of the given user. In this case, we treat the downloaded tweets the same way we explained in Section 4.1.1 for real-time tweets.
4.2. Process text data 43 4.1.4 Treating Errors When using the Twitter API, different errors can happen: from connection and network errors to HTTP errors and rate limiting. When an error occurs, the connection is lost and we need to reconnect. In [10] we can observe the different error codes and the recommended waiting times before reconnecting, and this information is summarized in Table 4.1 Table 4.1: Twitter API Errors and Times. Error Type Start Waiting Time Step Maximum Waiting Time IP Error 250 ms 250 ms 16 s HTTP Error 5 s Double 320 s Rate Limit 900 s – 900 s Fortunately, the adaption of the API made by tweepy treats the rate limit errors by itself. Therefore, we only have to treat the other errors. In the appendix we show the code used to handle errors. This code treats also rate limiting just to do it more general and in case something was not captured by tweepy 4.2 Process text data Dealing with data in text format is usually more complicated than doing it with numerical data. During the experiments we had to work with text doing, for example, word frequencies. To do it in a correct way, it is important to preprocess the text. There are typical and essential methods that are usually used for text data. In addition, for our case there are specific procedures for the Twitter environment. The text data is first processed changing it to lower case and eliminate symbols, which is a very obvious operation. A second common process is eliminating the so called stopwords. The stopwords are words that are used a lot for grammatical purposes that do not contribute significantly to the meaning of the text. For example, words like I, is,are,for,of, etc. It is important to ignore this words so that they do not influence word frequencies. We obtained the list of stopwords from [1]. Another process is the stemming, which consists in changing the words for their stems, so that for example words like car and cars count as the same. This is a less relevant process that does not have an effect as important as the others. As for the modifications done because of the Twitter environment, we have removed user mentions (e.g. @twitter), hashtags (e.g. #python27) and URLs (e.g. https://example.url.com) using regular expressions. This is to avoid the names of users counting as words, prevent event hashtags (e.g. #superbowl2017) from influencing the word frequencies and finally prevent URLs from counting as words.
44 4. Experiments 4.3 Compare Users In some of the following experiments, we will have to rank and compare users. There are several ways to compare text data; in particular, if we consider every Twitter user –its timeline– as a document, we could operate with a highly used statistic called TF −IDF . It stands for Term Frequency - Inverse Document Frequency and it is intended to reflect how important a word is to a document in a collection of documents [7]. The T F −IDF for word win document dis computed as follows (TF −IDF )w,d = (T F ·IDF)w,d =TFd(w)·log( D df(w)) where TFd(w)is the frequency of word win document d,Dis the total number of documents and df(w)is the number of documents where the word wappears. This statistic is high for words that appear in a few documents with a high frequency, i.e. it favors the frequency and exclusivity of terms. For each document d(or in our case, each user) a TF −IDF vector vT F −IDF dis computed with a value for every word. Then, every two documents can be compared using a cosine similarity with their respective vectors, CS(d1, d2) = vT F −IDF d1·vT F −IDF d2 ||vT F −IDF d1|| · ||vT F −IDF d2||, which gives a value between 0 and 1 that represents how similar the two documents are. Unfortunately, for the TF −IDF statistic to work well, the total set of Ddocuments should be random and enormous. The Twitter API has strict rate limitings when getting user timelines (see Section 4.1.3), which makes it unfeasible to have a proper set of documents to use the TF −IDF. It is possible to obtain the timelines of the users we want to study but not the timelines of enough random users to have a proper random set of documents. Hence, we had to user a different way to compare documents, and we did it based on the principles of the TF −IDF . We call the statistic we used TF −IGF, which stands for Term Frequency - Inverse Global Frequency. Again, the TF −IGF is calculated for every document dand every word was follows (TF −IGF)w,d = (T F ·IGF)w,d =T Fd(w) GF(w) where TFd(w)is the frequency of word win document dand GF(w)is the global frequency of word w. When we say global frequency, we would ideally mean the frequency in the whole Twitter data, but in our case we mean a big enough amount of data, which will be defined later on. This statistic, similarly to the TF −IDF , favors the words with a frequency higher than average. Then, to compare documents (Twitter users) we can do a cosine similarity again, using the vectors vT F −IGF dfor each document, CS(d1, d2) = vT F −IGF d1·vT F −IGF d2 ||vT F −IGF d1|| · ||vT F −IGF d2||,
4.3. Compare Users 45 which will again give a value between 0 and 1 that captures how similar the documents are. Furthermore, note that each vector can be written as vT F −IGF d=td(w1)/Nd tG(w1)/NG ,td(w2)/Nd tG(w2)/NG ,..., td(wn)/Nd tG(wn)/NG= NG Ndtd(w1) tG(w1),td(w2) tG(w2),..., td(wn) tG(wn)∝td(w1) tG(w1),td(w2) tG(w2),..., td(wn) tG(wn) where td(w)is the number of times wappears in d,Ndis the total number of words in d(counting repetitions), tG(w)is the number of times wappears globally and NG is the total number of words in the global data. The fact that we can extract NG Nd out of the vector means we can ignore it when comparing vectors, because it is a scalar that will be canceled by the normalizations of the cosine similarity. This is convenient because we avoid operations with very large numbers. As we said, to work properly, the statistic needs a big amount of data to compute the global frequencies. However, this time the data can be constituted of a large amount of random tweets; there is no need for whole documents. This is the crucial aspect that makes this statistic feasible. The Twitter Streaming API offers the possibility to obtain a random sample of tweets that are being posted on real time, and it provides approximately 60,000 tweets per hour. We downloaded and collected this random samples of tweets in hourly batches. Then we organized them in days cumulatively, one set for the first day, on set for the first two days, one for the first three days, and so on. This way, when adding each day, we can observe the difference in makes. The idea was to not stop downloading, and when using this statistic, use all the data that had been downloaded until that moment. However, it would not have been wise to start using it from the beginning, because it would not be representative. Hence, we decided to start using this data when the average of the relative difference, after adding a new day, of the frequencies of the most common 100 words was less than 1%. In the following Table 4.2 we can observe how the relative difference of how the word frequencies. Note that, for example, in column "3→4" we do not compare day 3 and day 4; we compare the first 3 days with the first 4 days of data. Table 4.2: Relative difference (in %) between days of data. 1→2 2 →3 3 →4 4 →5 5 →6 6 →7 7 →8 8 →9 9 →10 5.032 2.073 2.033 2.184 2.069 1.005 0.732 0.714 0.692 Note that the difference increased between days 4 and 5. This maybe caused by an important circumstance that made the postings of a particular day a little different. However, this problem is only noticeable because it happened in the first days, once we have enough data, cases like these will not affect the global frequencies. Therefore, we started computing the first comparisons using as a global frequency the joined data of the first 8 days. From then, we always used the newest data available.
52 4. Experiments Algorithm 2 Timeline Algorithm for Community Structure %Uis the set of users and Upis the set of user obtained in the previous iteration. % At the beginning U=U0and Up=∅, where U0is the initial set of users. while True do for all uin Udo Look at u’s timeline. end for Rank the users in U. U=The best ranked users. if U== Upthen return U else Up=U U=∅ for all uin Updo Add u’s friends to U. end for end while Algorithm 2, unlike Algorithm 1, follows the logical structure of the community, jumping through following relations in every step instead of retweets. Recall that Aretweeting Bdoes not necessarily mean that Afollows B. Therefore, this is a more logical algorithm to find a community by approaching its center until the core. The analogy of this algorithm in real-life communities would be that an individual would ask several people about a topic and would pay attention to the ones that are more interesting (better rank). The problem about this algorithm is the number of timelines that need to be downloaded in every iteration: all the timelines of the friends of the best ranked users. Recall from Section 4.1.3 that only between 6 and 10 timelines can be downloaded every 15 minutes. Therefore, this algorithm would take an excessive amount of time to finish converging to the core. Nonetheless, the point of this experiment is to see the structure of the community, and we do not need all the iterations to see it. The key is how will the ranking be done systematically, without actually looking at the timelines the way we did in Algorithm 1. To simulate how a real user would rank other users by looking at their timelines, we thought of ranking by comparison. For every user, it will be compared according to Section 4.3 with a known core user obtained by Algorithm 1. The idea is that the more similar a user is to a core user, the better rank it has, because core users have the best rank. The correspondence with real life is that a user would rank others by comparing them with what he has in mind of a perfect user. We have done the first iteration of this algorithm from an initial user that shows some interest in the Arctic climate change. We have downloaded the timelines of its 140 friends and compared them with a core user. In addition, we have observed this 140 timelines by inspection in order to check that the algorithm works right. Then we have been able to judge which of the 140 users are really users in the Arctic community, which are users of other similar communities like climate change and which are not
4.6. Ranking and Structure 53 related at all. In the following figure we can see the order of the users after being compared with a core user. Figure 4.5: Ranked and ordered users. In Figure 4.5 we can clearly see how the algorithm works as the community users are clearly the best ranked and the similar users are also better than all the others. To see it better, we provide a zoom of this image in Figure 4.6. Figure 4.6: Ranked and ordered users (Zoom).
54 4. Experiments This two figures are strong indicators that the algorithm works and that it provides a good ranking to continue the iterations and move towards the core. Hence, they also back the hypotheses about the structure of the community. In addition, we observed that one of the core users obtained with Algorithm 1 was followed by our starting point. And, as an extra experiment, we could check what position the core user would obtain when the comparison was made using other core users. We could observe that the core users came out always first or second at worst when using different core users. Therefore, this algorithm would go fast towards the core. This is logical because the algorithm is ranking and we have stated that the core users should be the ones with the highest rank. Finally, it is important to say that the best ranked users obtained by the first iteration of this algorithm really provided better information than what we had at the starting point. This results are provide strong support to think that users in a community are connected to better ranked users (structure hypothesis) and that they are able to rank users and they do it when selecting who to follow (rank hypothesis). 4.6.2 Friends Algorithm In the following we present the second used algorithm to observe a community structure. Algorithm 3 Friends Algorithm for Community Structure %Uis the set of users and Upis the set of user obtained in the previous iteration. % At the beginning U=U0and Up=∅, where U0is the initial set of users. while True do for all uin Udo Collect u’s friends. end for For every friend collected, compute the number of appearances. U=The users that appear the most. if U== Upthen return U else Up=U U=∅ end while Algorithm 3 also follows the logical structure of the community, iterating over friends instead of retweets, being also a more logical algorithm to find a community. In reallife communities it would mean that an individual would ask several people for better users and would pay attention to the ones that were mentioned the most. This algorithm is better than Algorithm 2 when it comes to execution time. Unfortunately, we found that the algorithm did not work as good as we expected. The reasons that made us think this would be a successful algorithm were that, in the first place, the better a user is, the more followers it will have in the community. In addition, since a community is found when its core is found, then everyone should
4.7. Filtering 55 have some connection with the core and this algorithm should converge to it. Indeed, we observed that from the seven users of the first iteration, six followed a core user. However, the results did not capture this ideas. When doing the first iteration of this algorithm, we could see that the users followed by more people where not users of the community but social celebrities. Like, for example, Barack Obama. Moreover, we also observed the appearance of users that were not publicly popular. We have called this the celebrity noise and the proximity noise. The celebrity noise is the appearance of celebrities in this algorithm due to the amount of followers they have. The proximity noise is the appearance of users in this algorithm not because they are better users in the community but because their close connection to the users of the iteration; it could be because family relation in real life, attendance at the same college, etc. These errors are something that is logical and does not contradict our hypotheses. After these results, instead of discarding the experiment, we tried something else. Convinced of the structure communities have, we repeated this algorithm but instead of picking the friends of all the users followed by the starting point, we took only the friends of the users that were actually members of the community. Using this variation, we could clearly see that with every iteration we obtained better users of the community and advanced to the core. The reason why the core did not appear immediately but around the third iteration is that, even though almost everyone follows someone in the core, not everyone follows the same core member. This would mean that for communities to be easier to find, cores would need be small; in fact, in the communities we have observed, the core is rather small. This variation of the algorithm is not that useful because of the need to choose the actual members of the community instead of just taking all the friends systematically. Understanding that Algorithm 3 does not work perfectly, we think is an interesting future research to come up with a new algorithm that works better. The idea is that there is actually something going on, as seen when using the variation, and it would be interesting to use is in a more systematic way. To sum up, despite the unsatisfactory results, this experiment (with its variation) still supports our hypotheses on the structure of the community. In fact, together with the results from Algorithm 2, we are confident about the fact that communities have a structure as presented in Section 2.6. 4.7 Filtering In this section we will provide experiments to support the last hypothesis about the content filtering in information communities. Recall that this hypothesis states that some core users of a community provide the most relevant information not only by generating it but also by sharing content from others. This content, obviously, has to be filtered, so that only the best is shared. We find it important to mention that for the core found for the Arctic community, the user @NSIDC_ArcticIce is clearly not filtering content because it almost never retweets and only posts. This does not contradict any hypotheses, because the filtering
56 4. Experiments hypothesis says that part of the core performs a filtering task. Actually, in Figure 4.3 we can clearly see that its connection is lower than the others. As we mentioned in Section 4.4, it is logical that users are more interested in the information posted by the users they follow than the one posted by the users that follow them. This is because the content they receive comes from the users they follow. In addition, we observed that users usually follow others with more followers than them, because it could mean they are more interesting and/or popular. Therefore, we could say that users usually retweet users they follow that are better than them – and probably have more followers. However, we would expect core users to share (retweet) information from users that are worse than them but sometimes provide good content and they share it. In the following figure we observe for some users in the Arctic community the percentage of people they have retweeted that have less followers than them. Figure 4.7: Percentage of reweeters with less followers We can observe how core users retweet more users that have less followers than them. We believe them to be potential writers of interesting information that the core users spot and share. However, this results could be biased by the fact that core users would have more followers than the rest of community users. While that could be a problem, within the users in Figure 4.7 there are users with a big number of followers – although not higher than the core ones. It would be an interesting next step for future research to double check this experiment with a lot more users. In addition, if we observe for a core user all the retweeted users that appear in its timeline and we join them by the number of followers they have, we obtain the following Figure 4.8.
4.7. Filtering 57 Figure 4.8: Retweeters of @ZLabe by number of followers Note that the bins of the bar graphic are not all of the same length. As expected, we can see that the core users retweets a lot of users that have a little number of followers. This information can be interpreted better if we plot the rate at which the core user retweets all these users. We have this additional plot in Figure 4.9. Figure 4.9: Scaled retweeters of @ZLabe by number of followers Using now the information provided by both graphics, we can see that even though the core user retweets a lot of users with few followers, the rate at which it retweets them is low. This can be interpreted as follows: the users with a small number of followers are users of the community that sometimes post interesting information, but they do not do it regularly nor frequently. The core user, follows a lot of them (Figure 4.8) but only retweets them when they post something relevant (Figure 4.9) in order to share it with the community. This way, core users would perform a content filtering task as described in Hypothesis 6 to collect information of the community and provide it in an easy way.
58 4. Experiments As an additional experiment to inspect the filtering we observed users from the community that had at some point been retweeted by core users. With this users, we observed if they were retweeted more when they had been retweeted by core users than when they had not. If the number of retweets was greater when core users were involved, it would support the idea that core users spot interesting information from small users and they share it with the rest. The results we obtained were good but expected, the average of retweets users got when retweeted by core users was higher. However, this can be associated to the fact that the core has more followers, and therefore obtains more retweets when posting content. We consider this experiment not to be conclusive enough to prove anything about the filtering. However, we could see that our hypothesis was not clearly contradicted either. We did a final test that consisted on taking a group of users of the community (taken as followers of at least 3 core users) and we downloaded all their timelines. With this information, we looked at the users that retweeted the most in this timelines and also which were the most popular tweets in this group within the community. In the following Figure 4.10 we can see an histogram of the number of retweets done by every user within the given group. Figure 4.10: Histogram for the number of retweets of the users of the community. We would have expected the core users to be the ones with more appearances in this histogram. However, we saw it was not like this, because it was biased by the number of tweets. Core users in showed around 1000 appearances. The top users we obtained
4.7. Filtering 59 where the ones that posted an enormous number of tweets and retweets. And while some of them were Arctic-related, they did not look like core users because of the excess of information they posted. On the other hand, when we observed the popular tweets, we could see some interesting results. For example, looking at the 10 most popular tweets, we could observe: All of them were related to the Arctic climate change or at least the climate change. Seven out of ten were posted or retweeted by a core user. Some tweets Arctic related and came from users in the general climate change community. From these results we can interpret that the more popular tweets within the community are the ones that are written or retweeted by core users. This supports the hypothesis that the core is filtering the content in the community. As for the popular tweets that were not written nor retweeted by the core, we believe that the logical argument to explain their popularity is that they come from core users that are members of a bigger community. For example, we could understand the Arctic climate change community as a subcommunity of the climate change community. However, it is not within the scope of this thesis to study the overlapping structure of information communities. We believe believe our experiment should work with a top community, meaning that it is a community which is not part of any other one. This is an interesting path for future research. It would also be challenging to extend the model with filtering functions that are more complex than a simple threshold.
60 4. Experiments
5 Conclusions In this work, microscopic properties of information communities in Social Networks have been studied. The first objective of this thesis was to, through observation, come up with interesting properties of communities. In the detailed hypotheses of Chapter 2 we provided possible properties supported by strong logical reasoning and arguments based on real life observation. The study of a mathematical model in Chapter 3, apart from being a useful study to understand how game theoretical models work, it also provided a way to model and analyze the majority of the hypotheses that we proposed. It would be an interesting topic of future research to use this model, for example, to define the way in which communities are formed and found in a way that is coherent with Hypothesis 2. The model presented is simple enough to offer the possibility to add extensions to it, as it was done with the content filtering. Therefore, we believe that it could be extended to take into account all the proposed hypotheses. In Chapter 4, we did small experiments with data downloaded from Twitter to see if we could observe behaviors that were consistent with our suppositions. While we obtained very good results for some of the hypotheses, they were not that good in, for example, the ranking and structure. However, the obtained results still are coherent with the hypotheses. It is necessary to recall that we were bounded by time limitations from the Twitter API. In future research, it would be intriguing to perform the experiments with a lot more Twitter data or do it in other online Social Networks with less restrictions. Being aware that the performed experiments are not enough to confirm our theories, we believe that they provide enough information to capture significant behaviors. And, together with the logical reasoning of the descriptions in Chapter 2, we believe we have a solid picture of how information communities operate in Social Networks. We are convinced that information communities exist in Social Networks. It is something undeniable that is both supported by our experiments and other literature. We strongly believe that communities are easy to find, because otherwise it would make less sense to have them. The experiments about this hypothesis where successful but small, and doing some larger experiments would be a great way to continue this research. About the ranking and structure, we truly believe that users in a community are able to similarly rank other members and also that they are connected to better users
68 A. Codes @_decorator def http_error (self , status_code ): msg = ’ HTTP error , status code {}. Retrying in {} seconds . ’ msg = msg . format ( status_code , self . sleep_http_error ) print msg time . sleep ( self . sleep_http_error ) self.sleep_http_error = min(self.sleep_http_error + 0.25, 16) @_decorator def network_error (self , status_code ): msg = ’ Network error , status code {}. Retrying in {} seconds .’ msg = msg . format ( status_code , self. sleep_network_error ) print msg time . sleep ( self . sleep_network_error ) self.sleep_network_error = min(self.sleep_network_error * 2, 320) A.2 Treating Tweets The following code shows the object used to store tweets and how we treated their text. ################################ # TFG 2017 # # Code : utils . py # ################################ import cPickle import re from collections import Counter from WordCount . stopwords import stopwords mentions = ’(?: @[\ w_ ]+) ’ hashtags = ’ (?:\#+[\ w_ ]+[\ w\’_\ -]*[\ w_ ]+) ’ urls = ’ http [s ]?://(?:[ a-z ]|[0 -9]|[$ -_@ .& amp ;+]|[!*\(\) ,]|(?:%[0 -9 a -f ][0 -9a-f]) )+ ’ pattern = re.compile(’| ’.join([mentions ,hashtags,urls])) class Tweet ( object ): def __init__ ( self , tweet ): self .id = tweet .id self . created_at = tweet . created_at self . author = tweet . author . id self . text = tweet . text self . retweet_count = tweet . retweet_count if ’retweeted_status’ in tweet . __dict__ : self . retweet_id = tweet . retweeted_status .id class BatchCount ( object ): def __init__ ( self , counter , total = None ): self.counter = counter self . total = total if total else sum ( counter . values () ) def __add__ ( self , other ): return BatchCount ( self . counter + other . counter , self . total + other . total )
A.2. Treating Tweets 69 def update ( self , other ): self . counter . update ( other . counter ) self . total += other . total def process_text ( text ): words = [ str (w) for w in re . compile (r’\W+’) . split ( re . sub ( pattern , ’’, text ). lower ())] tokens = [w for w in words if w not in stopwords ] return tokens def process_timeline ( raw_timeline ): c = Counter() [c. update ( process_text ( tweet . text )) for tweet in raw_timeline ] return BatchCount (c) The object Tweet is the one used to store the tweets so that only the information we want is saved. BatchCount is used to store text data from tweets as a word count. It is used both for user timelines and for hourly batches of downloaded Twitter information. The function process_timeline takes a downloaded timeline and processes its text (using process_text) and returns a BatchCount object which is easy to manage.
70 A. Codes
B Catalan Politics Core In this section we show the results obtained using the 1 on the Catalan Politics (ERC) community. We present the same graphics we showed in Section 4.5 for the Arctic community. Figure B.1: Shared followers for the Catalan Politics (ERC) Community.
72 B. Catalan Politics Core Figure B.2: Shared friends for the Catalan Politics (ERC) Community. Figures B.1 and B.2 compare the shared followers and friends that the core users show against random users of the community. We can observe how for the friends the difference between core and random is not big, but it is very significant with the followers. This makes sense because the random users we picked are users of the community and it is logic that they follow the same important people. For example, they probably follow the core. On the other hand, in the followers graph, the core has a lot more in common than the random users, because the majority of people of the community follow them. In addition, Figures B.3 and B.4 show a graph with the follower-following relation of the core users and the random picked that considers retweets. We can clearly observe the higher connectivity they core presents.
73 Esquerra_ERC gabrielrufian 27 JoanTarda 70 junqueras 51 vicepresicat 50 martarovira 24 120 64 38 4 22 419 26 14 7 285 46 46 132 98 216 422 41 80 125 17 Figure B.3: Relation graph for potential core users in the Catalan Politics (ERC) Community. ERC_elvendrell cristian_agudo JosepBargallo 3 alfonsjm uripir DUMICO_10 3 Figure B.4: Relation graph for random users in the Catalan Politics (ERC) Community. In conclusion, this results supports the hypotheses in the same way the results from the Arctic community did.