{'fraction_non_alphanumeric': 0.027125717266562335, 'fraction_numerical': 0.008278333446735162, 'mean_word_length': 5.035865845311431, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Opinion-based Homogeneity on YouTube : Combining Sentiment and Social Network Analysis

When addressing public concerns such as the existence of politically likeminded communication spaces in social media, analyses of complex political discourses are met with increasing methodological challenges to process communication data properly. To address the extent of political like-mindedness in online communication, we argue that it is necessary to focus not only on ideological homogeneity in online environments, but also on the extent to which specific political questions are discussed in a uniform manner. This study proposes an innovative combination of computational methods, including natural language processing and social network analysis, that serves as a model for future research examining the evolution of opinion climates in online networks. Data were gathered on YouTube, enabling the assessment of users’ expressed opinions on three political issues (i.e., adoption rights for same-sex couples, headscarf rights, and climate change). Challenging widely held assumptions on discursive homogeneity online, the results provide evidence for a moderate level of connections between dissimilar YouTube comments but few connections between agreeing comments. The findings are discussed in light of current computational communication research and the vigorous debate on the prevalence of like-mindedness in online networks.

When addressing online homogeneity, there might still be differences between homogeneity at a large scale, referring to the whole network (e.g., the whole platform) which covers the full range of the topical discussions, and sub-networks in which discussions are based on reciprocal responses. Consequently, we ask: RQ2. How does opinion-based homogeneity vary between analyses on a macro level (i.e., focusing on discussions across the full network) and a micro level (i.e., focusing on sub-networks) among YouTube comments?
To address these questions, this paper presents a combined approach of social network analysis (SNA) and sentiment analysis (SA). Crawling a multicontent social networking platform such as YouTube allows us to create a model based on unstructured German YouTube comments to predict the sentiment score of multiple users toward specific controversial topics. In particular, the present approach uses support vector machines (SVM) to predict the sentiment score on German comments of controversial political discussions on YouTube. These analyses were run for three different politically relevant topics: the right of same-sex couples to adopt children, 84 a ban on headscarves, and climate change. These topics have been discussed extensively in the public and represent good examples of divisive issues that are associated with fundamental moral questions.

Political Homogeneity in Online Communication
In many instances, it has been suggested that politically and civically relevant communication on social media can hold individual users captive in spaces in which they are exposed to political views that are in line with their pre-existing opinions (i.e., so-called "echo chambers") (Boutyline & Willer, 2017;Sunstein, 2017). In light of democratic ideals, politically homogeneous spaces are assumed to lead to political polarization and radicalization since users are allegedly caught in self-reinforcing networks which, in the long run, could become more extreme (Prior, 2007). When it comes to analyzing whether and how individuals might get "caught" in those like-minded networks, different (non-mutually exclusive) scenarios are conceivable (Flaxman, Goel, & Rao, 2016;Geschke, Lorenz, & Holtz, 2019): (a) users actively homogenize their network and, therefore, their information sources, (b) algorithms shape the ideological environment of users, or (c) users are incidentally exposed to a thread of like-minded information (e.g., when comments refer to other comments that are uniform in the stance they express). The present work focuses on the latter scenario and investigates to what extent user-generated comments on political questions are related to congenial comments by others. Initial evidence focusing on political homogeneity online showed that people are indeed connected to like-minded users to a larger extent than to politically opposing users in the United States (e.g., Bond & Messing, 2015;Boutyline & Willer, 2017). Theoretically, this pattern can be explained by the notion of selective exposure (Colleoni, Rozza, & Arvidsson, 2014;Knobloch-Westerwick, 2014;Zillmann & Bryant, 1985): People experience positive emotions when consuming information that conforms to their pre-existing views and feel stressed when the information contradicts their views. As a result, they seek out situations in which they are exposed to information that is in line with their views. This makes them more likely to affiliate with like-minded others and create homogeneous groups. While social media users may commonly be fully in control of their virtual acquaintances (e.g., in terms of friending or following someone or a news channel), they may not have full control over the information and stances 85 they are exposed to incidentally, for instance, when browsing through certain Facebook or YouTube news channels (Lu & Lee, 2018). Following this logic, it seems worthwhile to ask to what extent users are actually exposed to and in contact with opinions they disagree with.
Empirical research addressing the potential existence of echo chambers in online networks has been based on two different approaches: On the one hand, survey research has relied on subjective estimates by social media users. This line of research, asking participants how frequently they are exposed to opinion or ideological diversity, has shown that on social media, people are incidentally exposed to heterogeneous opinions (e.g., Kim, 2018;Lee, Choi, Kim, & Kim, 2014;Lu & Lee, 2018;Vaccari et al., 2016). On the other hand, another series of studies used observational data and made use of computational methods, especially focusing on SNAs.

The Assessment of Political Homogeneity Online based on Social Network Analyses
As a widely used method in research focusing on political homogeneity, SNA examines the properties of social networks -networks composed of people and their social connections with one another. In SNA, the property of an individual to seek social connections to other individuals with similar characteristics is called homophily. In other words, homophily is described as "the principle that a contact between similar people occurs at a higher rate than among dissimilar people" (McPherson, Smith-Lovin, & Cook, 2001, p. 416).
Several studies have therefore used network analysis to examine political like-mindedness in network data. Bakshy et al. (2015) analyzed Facebook data to examine the political homogeneity of friend networks to identify whether users read and share messages that are more consistent with their political ideological beliefs than cross-cutting content. Their findings showed that about 20% of users' Facebook friends were from the opposing party, which increases the probability that users will receive content that diverges from their own ideology. Another study focused on Twitter data to determine ideological homogeneity by analyzing 3.8 million Twitter users and a dataset of almost 150 million tweets on political and non-political topics (Barberá, Jost, Nagler, Tucker, & Bonneau, 2015). Their results revealed that Democrats were significantly more likely than Republicans to be involved in the cross-ideological dissemination of political and non-political information. Recently, Del Valle and Bravo (2018) ran an SNA of the Twitter network among Catalan parliamentarians and how information flows among them. Their study found that representatives are more likely to interact with members of their own party who share the same political interests.

86
On a methodical level, to identify echo chambers which are characterized by "disproportionate connections among ideologically similar political communicators" (Jasny, Waggle, & Fisher, 2015), the structural properties of the social network -specifically, the likelihood of connections between members of a group -need to be compared with the political views of the members of the network. If the two are related, that is, if there is a group of individuals with a disproportionately high density of intra-group connections compared to the number of outside connections, whose members share political views that they do not share with non-members, this group can be considered an echo chamber, that is, a politically homogeneous communication space.
The identification of political homogeneity, thus, requires two steps: identifying a group (i.e., a subset) of users who agree politically, and measuring whether there is a disproportionately high number of connections between group members. Researchers have used various methods for both steps.
A useful way of quantifying the relationship between intra-group and inter-group connections is the E-I index. It was presented for the first time by Krackhardt and Stern (1988) and compares the strength of internal connections between members of a class to the strength of external connections to non-members. Other studies examining political echo chambers used similar methods and based their conclusions on the E-I index, e.g., to assess the fragmentation between pairs of discussion networks or the effect of tie strength on the polarization in such networks (Bright, 2018;Chan & Fu, 2017). By using the E-I index, it is possible to quantify the degree to which members of a group interact with each other, as opposed to interacting with others outside the group.
In addition, the identification of political homogeneity requires information about the political affiliations or views of the members of a social network. With observational network data at hand, the arguably most accurate source for inferring an actor's political views is the set of posts and comments in which he/she expressed his/her viewpoints. Working with unstructured text data poses especially difficult challenges (Stieglitz, Mirbabaie, Ross, & Neuberger, 2018), but there are a few studies that have used methods from natural language processing to tackle this problem.

Identifying Political Opinions based on Sentiment Analyses
Natural Language Processing (NLP) is a branch of Artificial Intelligence (AI) that deals with the interaction between human language and computers to allow them to understand incoming information and process it independently. One subdivision of NLP is called Sentiment Analysis (SA), also known as 87 opinion mining. Machine learning approaches to SA classify texts by identifying their sentiment based on previously learned patterns. Machine learning "addresses the question of how to build computers that improve automatically through experience" (Jordan & Mitchell, 2015, p. 255). SA is a common tool to summarize emotional communication patterns on social media and is becoming increasingly important in the field of social media analytics (Stieglitz et al., 2018). Sentiment analyses are ideally suited to address the distribution of positive and negative viewpoints on a question of interest.
This method is of particular interest for the identification and further investigation of political homogeneity online. With this approach, it is possible to recognize whether and which people expressed a positive or negative stance on an issue and whether users are referring to each other.
There are only few studies on political homogeneity which use machine learning approaches to infer the political views of users from the content of their messages. Colleoni et al. (2014) classified Twitter users as either political or nonpolitical (based on training data from blog posts) and as either Democrat or Republican (based on training data from users' tweets). Their results suggest that the degree of homophily varies by political orientation: Democrats were less likely to have outbound ties to Republicans than Republicans to Democrats. Studies employing similar methodical approaches found that users are more likely interact with those who express similar views or stances than with those voicing dissimilar views (Himelboim et al., 2016;Williams, McMurray, Kurz, & Lambert, 2015).
While previous research, therefore, offers initial evidence on how expressed sentiments are spread all over a network, most previous studies investigated the Twitter network in which users are explicitly connected to each other (by the feature of "following") and this original connection might be subjected to selective exposure tendencies (i.e., getting virtually acquainted only to those who are politically similar). Still, it has been left open how users respond to each other on particular issues on platforms that have less structured networks (e.g., YouTube), increasing the chance of getting exposed to counter-attitudinal content. For this purpose, it is necessary to a) focus explicitly on discussions about specific political topics and b) analyze the network and its sub-networks that are formed based on these topical interactions.

The Present Approach: A Combination of Sentiment and Social Network Analyses to Assess Opinion-Based Homogeneity
So far, we are unaware of approaches in which homogeneity is applied to individual topics and simultaneously combined with automated content 88 analysis and SNAs. Previously, the determination of homogeneity was based on the basis of ideological classifications (i.e., the network patterns among liberals versus conservatives). We are only aware of few studies which examined polarization on the basis of topic-oriented approaches (e.g. Chan & Fu, 2017;Häussler, 2018). However, as public opinion forms based on issuerelated discussions, it is key to focus on the analysis on specific topics. To this end, a combination of NLP -more precisely, automated SA -and SNAs is necessary. The present approach is structured as follows: First, based on manually labeled comments, the SA is performed with an SVM to predict the opinion climate for the entire network. Second, the results of the SA are then transformed into a network structure to compute the opinion-based homogeneity using the E-I index.

Dataset
All data in this study were collected using a custom developed Python application which is directly connected to the YouTube API. Our application is able to collect multiple datasets by querying the internal YouTube search list, the video list, the comments list, and the replies list of each individual video. Each request to the respective list has its own URL that allows the API to be accessed and data to be collected2. For each list, we stored the requested data in a relational database.
The collected data contain the comments and replies of three controversial topics in Germany: "Kopftuchverbot in Deutschland" (headscarf ban in Germany), "Adoption für homosexuelle Paare" (adoption for same-sex couples) and "Klimawandel" (climate change) which also served as search queries. All of these topics are associated with political questions on which members of society have offered different answers. It has been suggested that especially morally loaded and controversial topics imply the potential to elicit processes of homogenization of opinion climates over time (Noelle-Neumann & Petersen, 2004). Accordingly, we believe that opinionbased homogeneity is more likely to be prevalent when focusing on such political topics (see Appendix A3 for more information about these topics).
When requesting the videos via search list, the parameter "relevantLanguage" was set to the value "de" in order to get primarily German content. Furthermore, we sorted the search queries for videos according to their relevance using the parameter "order," whereas the parameter value is set to "relevance." While the two datasets "adoption rights" and "headscarf ban" 89 were acquired on May 15, 2018, the dataset on "climate change" was collected on January 22, 2019. Each dataset contains the user-generated comments as well as associated replies. Table 1 provides an overview of the crawled videos with their corresponding search term and the data provided by this crawling. To analyze a more accurate selection of videos that reflect political issues, we filtered the videos by a specific categoryID4. In this case, a categoryID of 25 indicates the category of "Politics and News" in the YouTube API.

Manual Labeling
We created a human-annotated gold standard to create a sample of the 4,000 German YouTube comments for each topic by defining a coding scheme. This scheme ensures that the unlabeled data can be assigned to a unique class which represents the sentiment of the message. We use the term "sentiment" referring to comments expressing a positive or negative stance towards a specific topic (e.g., if a comment states "I hate headscarves," this comment is classified as having a "negative" opinion of headscarves). This does not apply to comments whose general tone is positive or negative if they do not explicitly express a stance on the respective controversy.
We selected two well-trained independent annotators who received the same dataset with 4,000 randomly selected comments and replies for each topic. The data were labeled considering three mutually exclusive classes: negative, positive, and others. The coding scheme with corresponding topics and the listed classes is represented in Appendix A 3 .
Agreement between the two annotators was measured using Krippendorff's alpha (Hayes & Krippendorff, 2007). The value of 0.63 was obtained for 3-class annotation of the adoption rights data, whereas a value of 0.67 was obtained for the headscarf ban data. In the case of the climate change dataset, a value of 0.54 was determined. All inter-annotator agreement values are valid for further processing. To ensure better results for the machine learning model, we decided to use only those comments for 90 further analysis on which both annotators agreed. This strategy guarantees that the sentiment can be clearly assigned to a unique class without inconsistencies. Table 2 shows the distribution of sentiment classes for each of the three datasets.
To derive the impact of the data showing a disagreement between the annotators (borderline cases), we later projected these data onto our trained model to determine to what degree our model takes these borderline cases into account. The contingency table and the graph can be found in Appendix B 3 .

Data Pre-Processing
We implemented multiple data pre-processing steps that structure and clean the data to decrease the level of noise in the subsequent analyses. These steps were the creation of a training (80%) and a testing set (20%), their cross-validation, and the transformation of cleaned comments to Term Frequency-Inverse Document Frequency (TF-IDF) vectors (for more information about the data pre-processing see Appendix C 3 ).

Support Vector Machine (SVM)
The application of SVM in text classification or SA has been successfully carried out in many studies. A recent study used the in-memory framework Apache Spark to apply a SA by using an SVM with an rbf kernel to classify microblog comments (Yan, Yang, Ren, Tan, & Liu, 2017). Al-Smadi, Qawasmeh, Al-Ayyoub, Jararweh, and Gupta (2018) compared the performance of recurrent neural networks (RNN) and SVMs on a comprehensive aspect-based SA of Arabic hotel ratings. The results indicate that the SVM performs superior to the deep RNN in terms of the research tasks (aspect category identification, aspect opinion target expression, and aspect sentiment polarity identification). However, the use of SVM combined with the network method to measure homogeneity/heterogeneity in online networks is novel. The results of the above-mentioned studies were very promising, and the performance of the classifiers was very high. Therefore, we decided to adapt them as a basis for our research.

91
The training of the SVM is realized by a pipeline (fixed sequence of steps) which starts by importing the cleaned training dataset and transforming the text data into numerical feature vectors to make them readable for the algorithm. We used a bag-of-words approach of assigning each word to an integer and returning a vocabulary dictionary in the form of a document-term matrix. The pipeline ends by fitting the TF-IDF vectors in the SVM. Combining the processes of 5-fold crossvalidation and grid search, we can initialize different parameters during training and localize the best combination of parameters for each fold separately. The best parameter set is used which reaches the highest subjective F1-score.
The F1-score is used to determine the performance of the model. Especially when the class distribution is uneven, it is more precise than the simple accuracy measure. In a systematic test, we used an SVM with a linear kernel based on the LIBSVM implementation (Chang & Lin, 2011) of scikit-learn (Pedregosa et al., 2011). The optimization of the parameters was carried out through a grid search in 5-fold cross-validation. Instead of only tuning the parameters of the classifier, we also tuned parameters that deal with the process of data pre-processing. The list of all tuned hyperparameters is given in Appendix D 3 .
The evaluation of the final model with their optimal parameters is based on the unseen test dataset. We apply the weighted F1-score as the metric to measure the performance of the model. Table 3 reveals the results of the prediction on the test dataset with their metrics. The normalized confusion matrices for the three datasets (see Figure 1) shows that the F1-score is strongly driven by the "others" category. Precision and recall for the positive and negative categories are lower. In summary, the confusion matrices show that the biggest performance losses are due to the classes positive and negative. In both classes, data is likely to be classified in the opposite category which may be due to the low amount of training data.
Since the classifier achieves valid predictions on the test dataset and an adequate F1-score of 0.85 for the adoption dataset, 0.88 for the headscarf ban dataset, and 0.83 for the climate change dataset, it was used to predict the sentiment of the comments across the whole dataset.
Some users wrote several comments, each of which may express a combination of stances. To simplify the visualization of the network structure and the calculation of homogeneity, each user was assigned exactly one class as follows. Platt scaling was used to generate probability estimates for each class and comment (Chang & Lin, 2011). In order to summarize these values, we calculated, for each user, the average probability of each class across their comments. The user was assigned to the class that was the most likely on average. For an overview of the distribution of the predictions, please see Appendix D 3 .

Building a Network on YouTube
In contrast to other social networking sites such as Facebook and Twitter, in which friendship requests and follower relationships play an integral role, the structure of the social network of YouTube users is not nearly as visible. Users can interact by commenting on videos and by commenting on other users' comments. In this study, we examined the interactions between users' comments, associated replies, and users who uploaded the video. Thus, the focus lies on the exchange of messages between users. The SNA is structured in three parts. The first part is the creation of the network using the YouTube data to visualize the interactions across all videos (see Appendix F 3 ). Statistics are used to provide a general overview of the network and to detect any conspicuous features. The second part deals with the computation of opinion-based homogeneity with the Krackhardt E-I ratio of the global network. The last part of the network analysis includes the segmentation of the networks into smaller sub-networks using the fastgreedy algorithm and the calculation of opinion-based homogeneity on a macro level (covering every comment on YouTube on that topic) as well as exchanges on the micro level (in sub-networks).
As we aim to identify the extent to which users have varying opinions on a particular topic, we decided to exclude the category "others" from the analysis as well as self-links. Topic modeling was used to gain an overview of the data that was thus discarded (Appendix E 3 ). The results show that the comments in this category were off-topic and therefore do not directly contribute to the discussion between proponents and opponents on the three controversies. The removal of these off-topic posts from the network led to the creation of isolated nodes that no longer had any connections to other nodes and, therefore, had a degree equal to zero. These nodes were also deleted from the network. To ensure that the results with the class "others" are not entirely ignored, we also performed the entire analysis on all three networks including this category. The findings can be found in Appendix F.
To understand and explore the network more closely and to gain a deeper insight, we have calculated various statistics and reported the results for the three datasets in Table 4.

94
The characteristics of all directed networks shown in Table 4 demonstrate that the average degree is about one, suggesting that a typical user interacts with approximately one other user. In general, accounts that have uploaded a video that many other users have commented on have a higher in-degree (comments addressed to them). In addition to the in-degree, the out-degree shows which users have interacted with other users the most frequently by writing a comment. The low density values might be explained by the fact that the data originates from a real network in which the users are not linked by friendships but by their comments to each other, as well as by the high number of nodes. This pattern seems plausible in a public network where the investigation and the focus is on comments. The combination of in-degree, out-degree as well as number of nodes and edges explain the difference in the diameter.

Measuring Opinion-Based Homogeneity
One of the main goals of this study is the measurement of opinion-based homogeneity based on the sentiment of comments. To measure the degree of homogeneity, the E-I index is an appropriate choice. The formula of the global E-I Index is defined as follows: where E is the number of external links to a given subgroup (sentiment) and I is the number of internal links to or between nodes within that subgroup (sentiment). The index is in a range of -1.0 to +1.0. A value of -1.0 indicates that the network is entirely homophilous with respect to the classes, i.e., all connections in the network are between members of the same class (alternatively, each connected component in the graph only involves members of the same class.). A value of +1.0 indicates an entirely heterophilous network in which there are no connections between members of the same class (i.e., a multipartite graph). In addition to measuring the global homogeneity of the network, it is possible to compute a homogeneity value for each specific class (or sentiment) to identify which sentiment has characteristics of a homogeneous interaction cluster. For example, the E-I index of the negative class would be -1.0 if all connections, both incoming and outgoing, that involve a member of the negative class were links to members of the same class. It would be +1.0 if there were no direct connections between any two members of the negative class. The index has previously been used in studies to investigate homogeneity in offline networks (Eveland & 95 Kleinman, 2013;Levendosky et al., 2004). To clarify the interpretation of the E-I index, Appendix F 3 shows three networks with different properties.

Identification of Communities and Extraction of Sub-Networks
The detection of sub-networks to calculate the opinion-based homogeneity of each community could give further clues about the opinion climate and possible differences between the macro and the micro level. Especially in sociology, it is necessary for many activities to identify the internal structures and groups of social networks. However, this can also be applied to online social media such as YouTube, Facebook, or Twitter in order to recognize the community structure of a network of users.
For this study, we used the fast-greedy algorithm introduced by Newman (2004) and Clauset, Newman, and Moore (2004) which is a hierarchical approach for the optimization of modularity in network analysis. This algorithm has already been applied to social network data from Twitter in several studies (e.g., Mercea & Yilmaz, 2018) and has also achieved the best results in the area of community detection based on modularity (Bello-Orgaz, Hernandez-Castro, & Camacho, 2017). The goal of this technique is to optimize the modularity to find community structures in the network. The higher the modularity score, the better is the sophisticated internal structure of the network represented. To determine the algorithm, we compared fast-greedy on a test basis with two other algorithms called Walktrap (Pons & Latapy, 2006) and Louvain (Blondel, Guillaume, Lambiotte, & Lefebvre, 2008); the results can be found in the Appendix G 3 .

Figures 2-4 show the graphical representations of all three topic networks.
The nodes in the network represent individual users of YouTube, i.e., users who have written comments, users who have responded to comments, and channel owners, some of whom have also written comments or replies. The color of the nodes represents their sentiment score: red for negative, green for positive, and black for channel owners who have not written any comments and are only in the dataset because they uploaded a relevant video.
Due to the aggregated probability values of the individual classes, it is easy to detect which opinion the users represent. The connections of the individual nodes to each other reflect their interaction in the form of comments. It should be noted here that this is a directed network, so it is possible to see the direction of the information flow. The hubs in the network represent channel owners who uploaded the videos that many users commented on. Furthermore, it can be seen that apart from the hubs, the connections to the individual nodes are distributed in a very mixed way and, thus, a heterogeneous opinion climate prevails.
Looking at the classes for each topic, it is evident that YouTube users more often comment on messages that express an opinion that is different to their own than on messages with a similar stance. This is corroborated by the E-I index which approaches +1.0 and the relatively small number of internal ties (see Table 5). In addition to the visualization of the entire network, the three largest sub-networks are presented graphically in Figure 5. The visualization of the sub-networks gives a more detailed view of the network because it offers evidence about the opinion-based homogeneity related to videos with a higher number of comments.

97
By dividing the network into sub-networks, the individual communities can be examined more precisely, i.e., structures of single or several channel owners are recognized more effectively.
When comparing the three largest sub-networks of each dataset, it is noticeable that sub-networks on the topics "headscarf ban" and "climate change" have a higher number of users responding to comments. This is in line with the significantly higher number of comments related to those topics. Furthermore, both topics are marked by denser network structures in which different channel owners are linked by users.
The sub-communities are relatively large, and they do not reflect homogeneous opinion climates with users unanimously speaking out in favor of or against a political decision. Instead, they show a moderately diverse exchange of opinions. By examining the sub-networks, a significantly more precise analysis and results can be created for the micro-level where only     Figure 5. Sub-networks. 100 specific sections of the whole network are visible. It can be noted that every sub-network exhibits heterogeneous behavior with regard to the opinion climate. Table 6 shows the results for sub-networks of global as well as class E-I Indexes.

Discussion
The present work was intended to (a) offer a new methodological approach to address opinion-based homogeneity using a combination of NLP and SNA and (b) provide preliminary evidence on the prevalence of opinionbased homogeneity regarding three (politically) controversial topics discussed on the platform YouTube. Addressing RQ1, results based on the combination of NLP and SNA did not offer evidence for opinion-based homogeneity regarding positively and negatively valenced YouTube comments on the topics of adoption rights for same-sex couples, the prohibition of headscarves, or climate change. Instead, we found a moderate level of opinion-based heterogeneity when it came to the connection, that is, cross-references among user-generated comments on YouTube. In other words, comments on these three 101 political issues were more likely to be connected to dissimilar than to similar comments. Regarding RQ2, it can be concluded that there are only minor differences between the macro and the micro level in the determination of opinionbased homogeneity versus heterogeneity. Both analyses -either focusing on the whole network or on sub-network -show similar structures. In particular, a closer look at the different sub-networks can lead to a more precise analysis because structures of individual communities can be focused, and opinion-based homogeneity can be calculated specifically. Given analyses at both levels, one cannot conclude that users on YouTube are exposed to a series of connected messages that all represent like-mindedness in terms of a uniform opinion climate. This result challenges previous research offering evidence for the, albeit weak, prevalence of ideological homogeneity of social networks such as Twitter (Bakshy et al., 2015;Barberá et al., 2015;Boutyline & Willer, 2017;Colleoni et al., 2014). These studies, however, focused on ideological homogeneity, that is, to what extent Democrats and Republicans interact with each other on platforms such as Twitter. Political discussions, though, may become diverse and include diverging viewpoints even within these ideological clusters. Moreover, as indicated by the same line of research, users still have ties to "the other side." While previous studies assumed that due to their cross-ideological connections, social media users might encounter content that is created or published by an ideologically deviant source (Bakshy et al., 2015;Barberá et al., 2015), it remained unclear whether users indeed encounter cross-cutting content. The present work provides initial evidence that users' opinion expressions are more likely to be associated with divergent than with congenial comments by others. In fact, this pattern is in line with the notion of "corrective action" (Rojas, 2010) stating that users feel encouraged to become outspoken online when they feel that their opinion is underrepresented. According to the patterns found on YouTube, this seems to apply as users tend to voice their political stance especially in relation to previous comments that were different to their opinion.
The only group with significantly more in-group interactions than out-group interactions, as evidenced by a negative class E-I index, is the "others" group (see Appendix F 3 ). This groups consists of users that discuss topics that are only vaguely related to the controversy in question (see Appendix E 3 ). From the results of the study, it appears that such comments commonly trigger a similarly off-topic response, leading to the creation of entire comment threads that diverge from the topic of the video. These groups are therefore homogeneous, but not with respect to their opinion on the topic of the video, which would be a prerequisite for the existence of opinion-based homogeneity in the sense of the present research questions.
The combination of machine learning and SNA allowed measuring opinion-based homogeneity by assigning opinions to a particular class, training a model based on these labelled data, and applying this model to all comments. Still, it should be noted that the values predicted by means of machine learning do not reach perfect accuracy due partly to the size of the dataset and the unequal number of samples for the different sentiment classes, especially for the over-represented class "others." However, the prediction of the test datasets gives us a rough impression of the extent to which the classification works well on previously unseen data and whether the model has generalized well or only classifies examples correctly that closely resemble the training data. Looking at the performance metrics, it can be seen that the model generalizes well with class weights that are suitable for rebalanced datasets.
In general, unbalanced datasets are a common problem in machine learning contexts which can be solved by crawling and labeling even larger and more balanced datasets to improve data quality and provide more training data for the model. In the pre-labeling procedure, we have also helped to improve data quality by only using records for analysis where both annotations matched. It is remarkable that most comments crawled on all three topics did not elaborate on the question of interest. This is in line with early research evaluating the deliberative ideals of online discussions which assessed that many contributions made by users are off-topic (Janssen & Kies, 2005;Min, 2007;Schneider, 1996). Consequently, while the present findings may allow us to be optimistic about the heterogeneity of political discussions on YouTube, it raises concerns about the relative weight of these on-topic exchanges in face of a huge number of off-topic interactions.

Limitations
Our method of crawling YouTube comments about three different topics does not represent the full landscape of the political discussion on this platform but rather gives an overview of three currently discussed debates and exchanges to determine the degree of homogeneity. One reason for this is the limitation of the YouTube API which only enables crawling a fixed number of comments and videos.
Another limitation which can affect the opinion climate in the analysis, is the imbalance of the labeled classes, making the training more challenging. Using 5-fold cross validation and class weights which can be used for addressing the generalization problem as well as for the hyperparameter search, we have tried to prevent the model from overfitting. However, one reason why the accuracy of this model is so high is that this over-represented class is more common in the training and test datasets, and it is therefore also predicted more often automatically. This also means that the accuracy of the individual models strongly depends on the available data. This, in turn, has a direct influence on the calculation of opinion-based homogeneity in the network. Increasing the amount of data would therefore also lead to the creation of a separate validation dataset which in the analysis could increase the accuracy of the model and reduce overfitting.
As a further limitation of the work, it should be mentioned that excluding the cases of disagreement between both annotators can influence the result of the classification and give a misleading impression of the accuracy of the classifier. To prevent this, a higher number of annotators would be necessary in order to have a uniform understanding of the comments and therefore increase the precision of the trained model. The results of the contingency table in Appendix B 3 show that most of these borderline cases belonged to the class "others," which is also the most frequently represented one in the dataset.
For the present study, the YouTube network was built based on the connection of videos, comments, and replies. Consequently, the network does not show the full connection structure between the individual users (e.g., friendships on Facebook). Accordingly, we consider homogeneity in the discursive sense between users although the criteria according to which the user selects individual videos or channels cannot be determined on the basis of this structure. In the present work, video uploaders assumed a key role as their opinion (provided that they expressed one) was a central connection node in the networks. Their stance was inferred from any comments they had made on their own and others' videos. Future research could also take the role of the video itself and its stance on the political question into account and investigate its interplay with the opinion climate that emerges in the related comment section.
While this applied approach has been limited to the YouTube platform, it is possible to apply the same approach to other social networking platforms such as Facebook or Twitter (using further political topics, in other language contexts) to measure opinion-based homogeneity there as well. A systematic comparison of homogeneity across different social media services will contribute to developing a robust understanding of the dynamics of political discussions online and the factors that determine whether they become homogeneous or heterogeneous.

Conclusion & Further Work
This study has developed an approach to measure opinion-based homogeneity based on textual messages with SA and SNA techniques on the YouTube platform by evaluating three relevant and politically controversial topics. Specifically, we investigated, based on communication data on YouTube, how expressed opinions in the form of user-generated comments are connected to each other and to what extent opinion-based homogeneity and heterogeneity mark the political discourse. In contrast to ideological homophily, which is more suitable for the recognition of moral values and political identities, the present approach allows the investigation of dynamic opinion climates which can change in the course of political discourses.
The combination of the two methods SNA and SA has shown that a measurement of opinion-based homogeneity based on YouTube comments is possible and can also be adapted to different topical contexts and a variety of social platforms. In the overall network, instead of finding evidence for opinion-based homogeneity, we found a moderate level of connectivity among dissimilar opinions expressed in user-generated comments. Thus, comments who expressed either a positive or a negative stance toward one of the three political issues were more likely to be associated with a heterogeneous than with a homogeneous environment. A similar pattern was found when the whole network was divided into sub-networks, e.g., in which a lot of comments were related to each other. Accordingly, this paper contributes to computational communication research in three respects: 1. It offers a blueprint for a combination of computational methods (SA and SNA) that enable the analysis of large communication datasets in light of potential social dynamics (such as communication content becoming homogeneous). 2. While previous network analyses focused predominantly on Twitter, this work relies on political communication content available on the platform YouTube, a platform that is growing as a political arena, especially for younger users. 3. Given the public debate about so-called echo chambers and political homogeneity in social media, this paper offers evidence based on automated analyses of observational data that extends previous research by not focusing on ideological homogeneity but on opinion-based and issue-related homogeneity.