Analyzing COVID-19 Protest Movements: A Multidimensional Approach Using Geo-Social Media Data
The talk will walk through the steps undertaken in the analysis of a protest network using Twitter data. It will explain the methods used, present the results as well as code and libraries used following (roughly) this outline:
- Motivation: What was special about the COVID-19 protest movement and why a multi-dimensional view is crucial for understanding.
- The Data: The retrieved information using Twitter's API and the necessary pre-processing steps.
- Spatial Analysis: The statistical means to understand the movement's spatial manifestation, including explanation of used methods, presentation of results.
- Network Analysis: Mere social network analysis is not enough for understanding protest movements. Including the spatial information allows to draw deeper insights by geo-spatially mapping network communities and centralities.
- Semantic Analysis: Understanding the dominating themes in the protest network with semantic analysis: generating the document embeddings, clustering topics and dealing with a large dataset of tweets.
- Conclusion: Importance of multi-dimensional analysis and the availability of social media data for studying societally important phenomena.
Python libraries that were used (among others): geopandas, networkx. berttopic, lda and friends.
This session took place in track Ethics & Privacy.
Transcript (auto)
Auto-generated from the recording utilizing Open-Source AI. Speaker labels (Speaker 1, Speaker 2) reflect diarization, not identity. Timestamps refer to the recording.
Speaker 1 [00:05]
So three years ago, COVID-19 happened, right? And it had a huge impact on our lives. We had policy measures that impacted, essentially, cut-off freedom, such as lockdowns. We had social distancing measures, traveling bans. And also, like, vaccination was a thing that was discussed. All these policy measures were, and I think it's fair to say, rightfully so, heavily discussed on social media. And it's not the only thing that happened. The concerning part about that was we observed actually a rise in the spread of misinformation, that is the voluntary spread of false information regarding COVID, and also the spread of conspiracy theories. So before I started my PhD, I didn't know about this, actually. This is just one example of one conspiracy theory that started during COVID. This particular narrative related somehow Bill Gates to the spread and the start of COVID, but there also were others, like, for instance, the 5G conspiracy theory that made telecommunication technology, in a broader sense, somehow responsible for COVID. So the interesting part about it is not only that, of course, these conspiracy theories probably happen and form and are discussed on social media, so in the online world, so to say, but they also have an implication in the real, I say real, I mean geographic world, right? Where we interact. So one of the ways we see that is in protest movements. People go out, they are mobilized to get on the street, demonstrate based on these conspiracy theory beliefs. But actually, like in the 5G case, people also attacked cell towers in the UK. That was a thing. So these beliefs are strong. And that's why I want to study, or what I did in the research is, I tried to analyze these COVID protest movements through this angle. So recognizing the fact that we only also have virtual communication, right? Social media, social media world, but also like the geographic interaction. And how this works, I would like to show you what I did. I would like to show you here. I would first like to talk about the data, geosocial media data. Of course, walk you through the approach that I used. Definitely also the Python lips and show you some results and give you a summary of that. what I would like you to take away and I'm successful if you do is the first point that social media data is extremely important for researching social movements and the availability of this data of course is tied to it as well and third thing is all of this research would not be possible if there wasn't so many libraries available let's start with the data so if we look at twitter data there are like let's say two kinds First thing, if we look at the Twitter user profile, what do we see? Well, lots of information. In this case, this is like an institution. It can be also a person. We see location information. That's important for us. We see follower, followees, a bit of metadata, description, and so on. So that's the user entity. But we also have the tweet itself. The tweet itself contains mostly short textual description, sometimes image, video, and, of course, a date and some metadata attached to it. That's the information that we have in general available. So the things that I want to focus on are the geospatial network and semantic dimension for these analyses. And all of this information was, up to a certain point in time, quite recently available via Twitter's API, at least for academic researchers, in quite a wide range, actually, in a quite large volume, with a nice API to retrieve. And now I'm going to talk about each of these dimensions in a bit more detail, what kind of data we have. When I talk about the network dimension, what I mean is the social network on Twitter. So the following thing, I'm going to briefly explain so that we're all on the same page. Take the following two statements. User one is followed by user three and user four. And user two is followed by three others. And if we put that and model the users as nodes, right, and connect the users with a directed edge if a followership exists between those two, then we end up in something like a graph data structure. that's what we do. We model social networks as graph. If you put it all together, we end up with a graph structure on the right side. Now, I told you I want to study COVID-19 protest movements. How do I do that? Well, if you think about the people who are maybe on these extreme views, beliefs, right? If they are, yeah, maybe far right, maybe have like these, yeah, let's just say extreme views, then I assume or we assumed in our research that a followership is likely due to like-mindedness, right? This also means that when we select the set of start users in the network and retrieve their followers, and maybe even their followers, we arrive at the set of, let's say, protest actors that we want to retrieve. This is actually quite a common approach. What happens here is, and this is what my colleagues in the communication science department did, this is journalistic research of people who are actively influencing, in our case, the Austrian COVID-19 movement. So politicians, political activists, in some cases doctors. Essentially, they compiled a huge list of people who are active, who are posting, and who are to some degree mobilizing and spreading false information. By using Twitter's API, we retrieved their followers and built up the network. So this is where COVID-19 protest comes in. So retrieving network data was quite simple. So once we knew who the users were, we also retrieved their Twitter handles. With the Twitter handles, we could extract the IDs. It's just some pseudocode, just like what we in general do. We have this list of start users or start node IDs. We iterate through them, get the followers of them. And if we want to do, we go even one level deeper and retrieve their followers. So we have like a three-layer network, whatever we want. And what we then do is, or how we use the data is, we can essentially use NetworkX. And in my case, I just stored the data in a data frame where each row is an edge. So we have a user ID, we have a follower ID, and each row is a directed edge from user ID to follower ID. You can store it differently. It's just the easiest way that came to my mind. And with that, it's quite easy to build up a graph. If you see below, the graph abstraction in NetworkX is a nice way. networks, it delivers a lot of ready-made implementations, algorithms that you can use on that, and this is essentially part where you have your data abstracted in a way that you can use it with Python. So that was the network dimension, the social network. In our case, users are the nodes and the edges are directed, yeah, the followership, essentially. Let's talk about location. So location is a bit tricky with Twitter. So up to a certain point, we used to have the possibility to crawl geo-referenced tweets, which means we said to Twitter API, hey, please, Twitter, give us tweets around this coordinate. And then you could be quite certain that these tweets came from that place, most likely through the application that the tweet was sent from. In our case, as I started a user network, that's a bit tricky. So what I started to do is I used the location from the user bio. And that's, of course, a bit tricky. Why? Well, this is one example. Sometimes people don't say, I'm in Berlin or I'm in Hamburg, but they say, I am in Germany. And Germany can mean quite a lot, right? So this is not entirely useful, depending on the scale of the analysis you want to do, right? But it's just not really fine granular. However, we need to translate this into geographic coordinates, and this process is called location geocoding. I'm not sure if you've heard of that. So this process essentially means, this is what happens when you open Google Maps and enter a location and just want to see where you want to go. It means taking the textual reference and translating it into coordinates, something like a geographic data form. And in our case, we used OpenStreetMap, and Germany, of course, is large, but Berlin is way more precise, so what you get is a so-called bounding box, right? the area where that kind of spans Berlin and you get the centroid that's the point and that's the coordinate we use in most cases. This is also something you can do in an automated fashion so GeoPy already delivers you quite a lot of geocoders implemented. We use Nominatum there's also here and I think Bing Maps and plenty others you can use and it's quite straightforward actually as I said here you just enter the locations and you create your client and go ahead and geocode and the nice thing is with nominatum you don't even need to register anything it's just open and free once we have that we arrive at oh wait a second sorry that's not what i want to say you can deal with the geodata in a geodata frame format right once you have the coordinates per user because that's what we started with we had a network of users we know where they are we geocoded their location and got a coordinate for that. So essentially we end up with, or I ended up with a data frame where I had for each user a reference, a coordinate. And that's what you can, this is where GeoPandas comes in. GeoPandas gives you geo data frames. It's essentially Pandas. You can do all Pandas operations that you want, but it has an additional column, which is called a geometry column per default, and it enables you to do spatial queries, meaning, please give me all points that are in a certain distance, or please give me all points that intersect with an area, whatever. That's kind of spatial queries. And also nice plotting functionalities. That's geopunders and geodata frames. Right, in my case, what the data looked like, just an excerpt, I had, of course, the user IDs, the original location they provided, and then the geometry that was constructed out of that. And the result of that actually looks like this. So this was the complete network I arrived with, or I ended up with, and I'm not sure how much time I have. I can actually discuss already quite a few problems with this plot. Maybe I'll do that later. The visualization I have here is an edge-bundled visualization. Each of the orange points is one user that was geocoded to that position in the globe, and the edges connecting those users have been bundled, meaning that when many connections go, for example, from Europe to the east coast of the west, they all follow along the same route. And the thicker the line is, of course, the more connections you have there. So what's remarkable, actually, we end up with a worldwide data set, or worldwide network in this case. Yeah, I'll tell it anyway. It's not ideal, because what we find out, we crawled onto layer two. So you have layer one, start users, layer two is the followers, and layer 3 is already too deep. That's why we end up so far spread out on the world. So the relevance, the like-mindedness I talked about is relatively... I'm pretty sure it's given for layer 1 and layer 2. For layer 2 and layer 3, we need to check that. Right. So that was kind of space and network. Now we're talking about the semantic information I have available. the research group i'm in has one very cool advantage we have a large database of continuous crawling of tweets it reaches i think i think up to 10 years back of geo-reference tweets that have been crawled scanned across the world this enables to do quite a lot of research and as i start my analysis for example later than covet was actually active i could crawl our database to retrieve some tweets and what I ended up with is I would say the time frame roughly when COVID was I say a thing 2020 to April 2022 roughly I ended up with six million tweets in the DACH region so I limited this part of the analysis to Germany, Austria, Switzerland, Liechtenstein. Something like 6,000 to 10,000 tweets a day depending on which time range and what's happening roughly something like that and then tweet text of course needs to be cleaned and in a way tweet text is a bit different and if you have large documents news articles they make sense tweets sometimes do not i mean i'm not active on twitter and sometimes if you read the things that you need to be like in you need to know what's going on to to understand it so this needs a bit of treatment you need to clean you need to for example remove words that are very very rare i have to add this is not my This is the code of a colleague who worked on that, so that's not my particular expertise. But we use NLTK for this case for the standard processing and regular expressions. Right, quick wrap up at this point. So what we have is we have essentially we have points on the map, right? Each point represents a user. Each user has a coordinate. And for each user, we have certain edges, directed edges to other users that represent a followership. And we also have, for the DACH region, a certain amount of tweets for each user. That's the data that we have as a wrap-up. And now we can go on and talk about a bit of the analysis, and this is going to stay high-level on the method side. We have, for example, when we do network analysis, something that you can grasp quite intuitively from this picture here is the concept of a community, right? If you see it, you'll know immediately. What it means is you have a group of nodes, a set of nodes in the network that are more densely connected within each other than to the rest. That's what you see here, right? Each of these gray bubbles has more connections to other nodes in the bubble than to external nodes. And there are several ways to detect those communities. This is called community detection algorithms. They're hierarchical ones. They're ones that optimize the modularity. They all have the same goal in the end, to detect some kind of cluster or a structure. What it means or how we can interpret this in our case is if you think about users in Twitter and information flow or the directed edge from one user to another one means this user gets the other user's feed. So this is like the potential for information flow. This would mean that communities here are, let's say, have kind of an information community. I think about it differently. If one person in this community says, I have a party or a social event going on, and the one person who's connecting to the other communities does decide not to retweep, that means there's going to be a party in the community. Right? This is how it's going to go. So this is fine, and this has been done several times. Network analysis is a thing in research. What is not being done so often is actually the spatial thing. So I'm going to show you now what we did with spatial communities. So we did the same thing for the protest network. We looked... You remember the fact that I told you that each of the nodes I was looking into had a position in geographic space and so we detected the communities for the European sub-networks, so not for the whole worldwide network but for the European one each color represents one community you see the largest one is primarily based in the UK and has some followership in Spain, France but what is interesting is we actually kind of redraw national boundaries here, we find Austria, Germany, Switzerland quite pronounced, we also found Denmark and what's it called? Netherlands? Sorry. Squizzy? Quite remarkable, actually, is the thing, the yellow one. I didn't write Barcelona. I should have. I'm sorry. That's an error in the plot. This is like the Catalan region, and it distinguishes itself from the broader context here. And just to remind you what we did, we did take a virtual network, right? The community detection algorithm doesn't know anything about the geographic space. We just calculated the communities and decided to plot them. And what we see are geographic boundaries. This means that the geographic boundaries are also present in the way we interact on Twitter. And that we're talking about as we're talking about like a protest network, we can interpret this as a let's say the protest network primarily organizes let's say nationally. It's very hard to make, to draw strong conclusions out of that and I also don't want to do that. you need to do more research here, but it's an indication, and which also makes sense we can talk about that later if you want Did you also find cross-border language communities? Say again? Did you also find cross-border language communities? Yes, I had a slide I decided to drop it I can show you later, if you want There are, but not as much as I expected. I would have actually expected that for example, the Dach region as its shared language would have been one large community, but it is not, actually. If you think about the size of Austria, Austria's population wise the size is Bavaria but it's one strong community and the influence of Germany is not as strong as you would have thought and it makes sense if you think about Covid because Covid primarily the protest was against the national governments, this was their enemy, it was not it didn't matter that Germany had the same problem and Tyrol, people did other things than in Vienna and so on very strong local movements same thing for centralities, centralities are a way to rank nodes in a network. There are different measures here that you can use. Just to speak to it like again in an example, if you think about these nodes that are connecting the others, yeah, the ones that are like at the edge also connecting other communities. These nodes have, let's say, a high control over the information flow. This could be a metric like edge-betweenness, shortest path edge-betweenness because this node lies on a lot of shortest paths from one node to another. This means, again, a tweet example is kind of similar here. This node controls what information flows from one to another. This is centrality. We can just score it, rank the nodes, and just know which nodes have the highest centrality, so a high importance. Now take that. I'm going to talk about spatial clustering. I'm going to put those two together in a second. Spatial clustering is a concept from spatial statistics. I'm not sure if you heard about it. It's essential of a measure of, if you look at something, a distribution spatially, how, let's say, spatially random a distribution is. On the left side, you find something that's near to one spatial structure. It's very, very small, but it says below Moran's eye. That's a global measure of spatial statistics. So this is really clearly divided. On the right-hand side, it looks more random, but it's not entirely random. If you look closely, there are these two points that have a bit of red clustering and the white clustering, so it's not entirely random, and that's what we want to catch when we do spatial statistics. We want to catch these, let's say, spatial clustering of something, of an effect, so that it's not spatially random, that's what we're looking for. And if you put that together now, centrality analysis with spatial, let's say, clustering analysis, we can find out, for example, for the importance of nodes, which regions where we have a lot of nodes with high centrality that are also surrounded by other people with high centrality. And then again, this shows you that COVID was, of course, something that was structured along national boundaries, but the people in the network who were, let's say, had high influence on the information flow, mainly in the DACH region and also not in Austria. If you look closely in Austria, of course, Austria has a lot of mountains, so there's a lot of, let's say, nothing going on. Please strike that. Vienna and Upper Austria, of course, strike out, and the rest of Germany. Whereas, for example, let's say non-German countries do not play that often important role. Instead, they have cold spots. Cold spots are the opposite of hot spots, which means they are actually surrounded by... So there are a lot of zero centralities which are also surrounded by zero centralities. I'm running a bit out of time, but I think I'm going to manage a bit of semantic analysis. So very, very briefly, we can do topic model analysis, which means we look into the text and the tweet text that I showed you. And what I was interested in is, I know, which if there are semantic themes in the clusters in the network that I found, right? I'm going to explain that in a second. So these are, for the DACH region, certain sub-communities that I identified. The plot is not ideal, but what you see is on the left side there is one user in Switzerland. It's a bit larger plotted because this user has a larger out-degree, which means potential of influence, like a lot of followers. And the network plot on the right is really not ideal, I'm sorry for that, but it's clustered around this one. That's one sub-community in the DACH, and the German-speaking network. There's another one, and this looks a bit differently, and you can see that there is not this big out-degree one person, but there are several people who have relatively high out-degree. It's, let's say, just a bit more evenly distributed. And what I wanted to see is if these communities talk about something distinctly. Ideally, actually, I wanted to find, I don't know, where is the anti-vaccine community? where is the conspiracy community spoiler, I did not find that yet let's see this is also still ongoing work in progress let's see maybe next year I can deliver a bit more but I took nevertheless the topics not the topics but the tweets that we had for these communities and run a simple LDA latent usually topic allocation this is kind of like a state of the art approach it's nothing new, nothing fancy but I like it because it has pi LDA which is quite easy to integrate in a notebook so you can visualize the topics that you calculate quite easily. So this one was a Switzerland, yeah, kind of Switzerland, I would say, focus-centered community, and you can find that these people here are discussing the, what's it called, public, Rundfunkgebühren, English. You know, in Germany you pay a certain amount of money for the public broadcasting services, that's what they're discussing, they don't like that. And it gets kind of clear if you look into the tweets and if you look into the topics here. That's one thing. And I should say I selected topics that were high like when COVID was peaking. The second one is actually a Turkish community. Like all three topics that I discovered in this community were all of Turkish-speaking tweeters. So again, you have these very, very interesting structures. This one actually tells us not so much about, let's say, spatial distribution, but this one is a bit more interesting Why? Because we have two more, two central players in Vienna and somewhere in Switzerland, right? And if they're already discussing something that is kind of anti-public broadcasting, this might be related to might. It's just a question mark, big one. I think I need to wrap up so that we also have time for questions. Conclusions. Okay, this was quite dense, right? We had a lot of things, but what I hope you take away is one thing, how to use social media data for research into social movements. This is like an ideal data source. So many things are happening, and it's also not only one kind of information. There's text, there's image which I didn't look at, there's lots of metadata, an excellent network. You can also look into communication networks, like who's retweeting what, and people do that and actually analyze how conspiracy cascades build actually and you can trace that and if you take the geographic reference with that one like next research goal could be to say how do these conspiracy narrative actually originated spatially is there something like a geographic origin of these things it's highly interesting and makes i say geo-social media a highly interesting data source for research but unfortunately things are currently closing down similarly like a big takeaway of course is I showed you all the libraries I use and this is definitely not possible if I don't have that. If you have research ideas if you want to contact me please do so I have a GitHub repository it does not hold a lot at the moment I plan to publish the stuff there at some point I just need to clean up thanks for your attention
Speaker 2 [25:29]
Thank you so much. Very inspiring how you do all this stuff. You can't imagine how many people don't know what they collect. Okay, so I have a question. Has the availability of data changed with the transition of Twitter into what is now X? Do company changes meaningfully impact your research?
Speaker 1 [25:52]
It's just not possible in the scale anymore. It's a big problem. We used to have up to 2 million tweets. Is that true? 1 million, I say? Georeference tweets per day by the Twitter API. The research group I'm in does not only do this kind of research, also disaster management, right? Where do people tweet about hurricanes, floodings, and whatever? It's such a powerful source for so many humanitarian aspects, which is unfortunately closed down since Twitter became X. Thank you.
Speaker 2 [26:28]
It is said that there can be up to 10% of fake-bot accounts on Twitter. Did you see some in your work and did you have a special way to handle those?
Speaker 1 [26:40]
Very good point. So I did not care about the fake accounts so much because most of them... Well, certainly, let me be honest, I found some, and I dropped the ones out that I found. What was more interesting for me was fake locations, and I looked into that, and I decided for this analysis to filter them out, but they're quite interestingly a lot of people who give Antarctica as their location. Now, while you're laughing, but there's like a connection, right? You know that there's, again, an Antarctica conspiracy theory. I did not check into that, but this might really be a link. There's so many things you can find if you just look. There's really, look it up, something like Antarctica.
Speaker 2 [27:21]
What tool did you use for the network visualization with the bundled edges on slide 21?
Speaker 1 [27:27]
oh yeah that's data shader i think there is an edge bundling algorithm available by data shader i find the documentation is a bit um yeah it has a bit of holes but i try to make it work i told you like i promise you now i'm gonna publish this thing and then you can look at it and you can just take whatever you want and
Speaker 2 [27:51]
By the way, do you know that there are people using for location just online or the world?
Speaker 1 [27:56]
Sorry, what was it? Sorry.
Speaker 2 [27:58]
And Twitter location where they leave some people saying online or the world or everywhere.
Speaker 1 [27:58]
And Twitter. Absolutely, absolutely. On a plane.
Speaker 2 [28:04]
On a plane.
Speaker 1 [28:07]
Not sure if I can show you that, but that's like some of the appendix slides I had. Not all locations are, of course, geocodable, which means we lose a lot of information, right? So 50% of users roughly did not even provide a location, and another certain amount was not. So OSM Nominatum takes a textual input and tries to translate it into geographic coordinates, but it's not always successful, so we lose information, and this also means we lose a bit of density in the network, of course.
Speaker 2 [28:34]
Have you tried to perform LDA over tokens, not words? Because with tokens, it could be much more easier to cluster topics. Yeah.
Speaker 1 [28:43]
I just run whatever my colleague gave me, to be honest. That's just still very much part of a work in progress. I experimented actually with Bird Topic at a later point of time, but yeah, I have to dig deeper into the LDA. This was just quick and dirty. Let's see what's in their thing for the conference, because I promised it in the abstract.
Speaker 2 [29:02]
Did you take into account that some users can use VPN? For Austria, it may not matter so much, but worldwide it should have an impact.
Speaker 1 [29:12]
But VPN would address, like, impact your IP address location, right? Not the location you use in your bio.
Speaker 2 [29:18]
two
Speaker 1 [29:20]
So no, I did not consider it
Speaker 2 [29:23]
Are there semantic analyses in English, German, or in several languages, for example, France, Spain? I guess not many tweets are written in English.
Speaker 1 [29:36]
Yeah, good point. I mean, I did the analysis only in German, so that's like a German analysis. It's an interesting point. So I did not do that yet in the other languages, but something probably... So if I do that, I need to translate, and I will. The question is, again, like, where's relevance?
Speaker 2 [29:51]
I have a good one. Do you think that it's possible that your idea of a COVID conspiracy network is itself a conspiracy theory?
Speaker 1 [30:12]
But on the other hand, it's not yet published, so I could be telling you anything.
Speaker 2 [30:18]
Can and did you differentiate between persons and bot accounts and tweets? Is there a known influence in your data?
Speaker 1 [30:26]
Yes, yes, yes. I did not detect bot accounts, but that's something I certainly do, should do.
Speaker 2 [30:27]
Yes, yes.
Speaker 1 [30:31]
That's on the to-do list for this analysis, definitely. Because they're 100% there, and there are some accounts that you just kind of feel that they are, from their posting behavior, but I did not explicitly detect them. As, again, I was interested in location connectivity, not so much in the fake news and the conspiracy at this moment.
Speaker 2 [30:50]
I want to thank you again. You are running out of time. Thank you again so much.