Geospatiality_data
收藏资源简介:
This repository contains code and data for reproducing the study Geospatiality: The effect of topics on the presence of geolocation in English text data. The study analyzed the frequency of geolocations in texts across several distinct datasets from different sources. These sources were: Twitter (X) Reddit Stackexchange GDELT IA-Americana Nairaland For each source, a dataset was acquired and tested for the presence of geolocations in the texts, as well as annotated with topic-labels. The scripts use as inputs the data from the zip files in the data directory. Files need to be unzipped before running the scripts. Note that usernames have been anonymized. E_Modeling.R Applies the mixed modeling approach described in the article. F1_Analyze_FracGeo.R produces figures and tables visualising FracGeo, the fraction of geolocated text items per supertopic and dataset (Table 3 and Figure 3). F2_Explore_Variables.R analyses FracGeo, across timesteps, authors, and text length (Figure 4). F3_Analyze_Models.R analyses the fixed effects of the GLMM models for each dataset, and compares their correlation across datasets (Table 4, Figure 5, and Appendices A1-A6). F4_Validate.R compares the georeferences and supertopic assignments of the models to the human annotations (Appendix 9 and Table 5). The file topic_taxonomy.xlsx contains the topic taxonomy which matches topics to site-specific categories (e.g. subreddits, subforums, stackexchange sites). For users without access to MS office, the file can be loaded using open scripting languages, for example R: library(openxlsx2) path <- "../2_Data_Processing/Topic_taxonomy.xlsx" tax_reddit <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Reddit") tax_Stackexchange <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Stackexchange") tax_Nairaland <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Nairaland") tax_GDELT <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_GDELT")
本仓库包含用于复现研究地理空间性(Geospatiality):主题对英文文本数据中地理定位存在性的影响的代码与数据。 该研究分析了来自不同来源的多个独立数据集的文本内地理定位的出现频率,涉及的数据源包括:Twitter(现X平台)、Reddit、Stackexchange、GDELT、IA-Americana、Nairaland。 针对每个数据源,我们均获取了对应数据集并测试了文本中的地理定位存在性,同时为数据集标注了主题标签。本项目的脚本以`data`目录下的zip压缩包数据作为输入,运行脚本前需先解压所有压缩包。请注意,所有用户名均已完成匿名化处理。 各R脚本功能说明如下: 1. `E_Modeling.R`:采用论文中描述的混合建模方法开展建模分析。 2. `F1_Analyze_FracGeo.R`:生成用于可视化FracGeo的图表与表格,FracGeo指各超主题与数据集下带有地理定位的文本项占比(对应表3与图3)。 3. `F2_Explore_Variables.R`:分析不同时间步、作者与文本长度维度下的FracGeo指标(对应图4)。 4. `F3_Analyze_Models.R`:分析各数据集对应的广义线性混合模型(Generalized Linear Mixed Model, GLMM)的固定效应,并对比不同数据集间的模型相关性(对应表4、图5以及附录A1-A6)。 5. `F4_Validate.R`:将模型输出的地理参考结果与超主题分配结果与人工标注结果进行对比(对应附录9与表5)。 文件`topic_taxonomy.xlsx`(主题分类表)包含了将主题匹配至特定平台分类(如子Reddit板块、子论坛、Stackexchange站点等)的主题分类体系。对于无法使用Microsoft Office的用户,可通过开源脚本语言加载该文件,例如使用R语言: r library(openxlsx2) path <- "../2_Data_Processing/Topic_taxonomy.xlsx" tax_reddit <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Reddit") tax_Stackexchange <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Stackexchange") tax_Nairaland <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_Nairaland") tax_GDELT <- openxlsx2::wb_read(path, sheet = "Topic_Taxonomy_GDELT")



