Abstract
Embeddings have gained traction in the social sciences in recent years. Existing work focuses on text-as-data to estimate word embeddings. In this paper, we turn to graph embeddings as a tool whose use has been overlooked in the analysis of social networks. Graph embeddings have two primary uses. First, to encode users and their interactions onto a single vector. Second, graph embeddings can be used as inputs for machine-learning classifiers. In this paper, we use the British political Twitter to illustrate both uses of graph embeddings. We encode users’ partisanship. Furthermore, we use an SVM and a NN to estimate the partisan proximity of Twitter users. Results suggest that graph embeddings yield high precision predictions.




Similar content being viewed by others
Notes
There are several legislators whose Twitter activity puts them below this threshold. This decreases our number of legislators to 561.
Results are robust to changes in dimensions (20, 30, 40, 50, 100, and 150). For computational parsimony, we use ten dimensions. Results using different dimensions are available authors.
We acknowledge that legislators tweet about other topics as well. However, their utterances tend to be dominated by political matters.
We define outliers as users whose Twitter bio identifies them as Labour and Liberal Democrats but our embedding, based on their Twitter activities, puts them in the vicinity of the Conservatives. To be sure, there are outliers in other areas of the graph. However, the observation of the graph suggests that the highlighted area has a particularly high number of outliers.
Results and technical notes are available from the authors.
N Outliers: 103 N Conservative: 246 N Tweets: 3003.
Tables S2–S5 in the online appendix show results per party.
We use ‘predict_proba’ property of the SVC function in the scikit-learn.
References
Barberá, P. (2015). Birds of the same feather tweet together: Bayesian ideal point estimation using Twitter data. Political Analysis, 23(1), 76–91.
Barberá, P., Jost, J. T., Nagler, J., Tucker, J. A., & Bonneau, R. (2015). Tweeting from left to right: Is online political communication more than an echo chamber? Psychological Science, 26(10), 1531–1542.
Cai, H., Zheng, V. W., & Chang, K.C.-C. (2018). A comprehensive survey of graph embedding: Problems, techniques, and applications. IEEE Transactions on Knowledge and Data Engineering, 30(9), 1616–1637.
Goyal, P., & Ferrara, E. (2018). Graph embedding techniques, applications, and performance: A survey. Knowledge-Based Systems, 151, 78–94.
Grover, A. & Leskovec, J. (2016). node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining. ACM pp. 855–864.
Hamdi, T., Slimi, H., Bounhas, I., & Slimani, Y. (2020). A hybrid approach for fake news detection in twitter based on user features and graph embedding. In International Conference on Distributed Computing and Internet Technology. Springer pp. 266–280.
Harris, Z. S. (1954). Distributional structure. Word, 10(2–3), 146–162.
Hobolt, S. B., et al. (2018). Brexit and the 2017 UK general election. Journal of Common Market Studies, 56(S1), 39–50.
Laver, M. (2014). Measuring policy positions in political space. Annual Review of Political Science, 17, 207–223.
Masood, M.A., & Abbasi, R.A. (2021). Using graph embedding and machine learning to identify rebels on Twitter. Journal of Informetrics, 15(1), 101–121. https://doi.org/10.1016/j.joi.2020.101121.
Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781.
Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems. pp. 3111–3119.
Řehůřek, R., & Sojka, P. (2010). Software framework for topic modelling with large corpora. In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks. Valletta, Malta: ELRA pp. 45–50. http://is.muni.cz/publication/884893/en.
Rheault, L., & Cochrane, C. (2020). Word embeddings for the analysis of ideological placement in parliamentary corpora. Political Analysis, 28(1), 112–133.
Rodman, E. (2020). A timely intervention: Tracking the changing meanings of political concepts with word vectors. Political Analysis, 28(1), 87–111.
Spirling, A., & Rodriguez, P. (forthcoming). Word embeddings: What works, what doesn’t, and how to tell the difference for applied research.” Journal of Politics forthcoming.
van der Maaten, Laurens, & Hinton, Geoffrey. (2008). Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov), 2579–2605.
Acknowledgements
The authors would like to thank Pablo Barberá, Michael Laver, Christopher Cochrane, and Carsten Schwemmer for helpful comments of early drafts. The usual disclaimer applies.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
On behalf of all authors, the corresponding author states that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Below is the link to the electronic supplementary material.
Rights and permissions
About this article
Cite this article
Won, M., Fernandes, J.M. Analyzing Twitter networks using graph embeddings: an application to the British case. J Comput Soc Sc 5, 253–263 (2022). https://doi.org/10.1007/s42001-021-00128-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s42001-021-00128-6