Skip to main content
QUICK REVIEW

[Paper Review] Predicting the Geolocation of Tweets Using transformer models on Customized Data

Kateryna Lutsai, Christoph H. Lampert|arXiv (Cornell University)|Mar 14, 2023
Human Mobility and Location-Based AnalysisSocial Sciences3 citations
TL;DR

This paper proposes a BERT-based multitask learning framework for predicting tweet geolocation using textual content and metadata, employing regression with Gaussian Mixture Models (GMMs) to improve spatial accuracy. It achieves a median error of under 30 km globally and under 15 km in the US, with a novel lower-bound constraint on GMM covariance to stabilize training and enhance geospatial performance.

ABSTRACT

This research is aimed to solve the tweet/user geolocation prediction task and provide a flexible methodology for the geotagging of textual big data. The suggested approach implements neural networks for natural language processing (NLP) to estimate the location as coordinate pairs (longitude, latitude) and two-dimensional Gaussian Mixture Models (GMMs). The scope of proposed models has been finetuned on a Twitter dataset using pretrained Bidirectional Encoder Representations from Transformers (BERT) as base models. Performance metrics show a median error of fewer than 30 km on a worldwide-level, and fewer than 15 km on the US-level datasets for the models trained and evaluated on text features of tweets' content and metadata context. Our source code and data are available at https://github.com/K4TEL/geo-twitter.git

Motivation & Objective

  • To develop a flexible, end-to-end NLP framework for predicting tweet geolocation using only textual and metadata features.
  • To improve geolocation accuracy on global and US-level datasets through fine-tuned BERT models and multitask learning.
  • To address the instability in probabilistic loss during training by introducing a lower bound on GMM covariance parameters.
  • To evaluate the effectiveness of GMM-based probabilistic outputs in modeling uncertainty and improving regression performance.
  • To explore the transferability of tweet-level predictions to user home location prediction using distributional modeling.

Proposed method

  • Fine-tunes BERT-based models on a custom Twitter dataset containing tweet text and metadata for geolocation regression.
  • Employs a multitask learning setup with shared BERT encoders and separate heads for regression (latitude/longitude) and GMM parameter prediction.
  • Applies a constrained GMM output layer where the minimum standard deviation is set to $\frac{1}{2\pi}$ to prevent PDF values from exceeding 1 and destabilizing the loss function.
  • Uses a combined loss function that balances L2 regression loss (squared Euclidean distance) and negative log-likelihood of the true location under the predicted GMM.
  • Transforms the BERT pooler output (768-dim) into two continuous coordinates via a linear head for regression and a separate head for GMM parameters.
  • Validates performance using median error metrics on worldwide and US-specific subsets of the dataset, with comparisons across data splits and model variants.
Figure 1 : Model finetuning procedure flowchart for the best of the proposed models which has the Probabilistic Multiple Prediction Outcomes (PMOP) output type and individual wrapper layers for Key Feature (KF) and Minor Feature (MF)
Figure 1 : Model finetuning procedure flowchart for the best of the proposed models which has the Probabilistic Multiple Prediction Outcomes (PMOP) output type and individual wrapper layers for Key Feature (KF) and Minor Feature (MF)

Experimental results

Research questions

  • RQ1Can BERT-based models fine-tuned on custom Twitter data achieve high-accuracy tweet geolocation prediction using only text and metadata?
  • RQ2How does multitask learning with GMM output improve geolocation accuracy compared to standard regression baselines?
  • RQ3What impact does constraining the GMM covariance parameter have on training stability and spatial prediction performance?
  • RQ4To what extent can per-tweet predictions be aggregated to infer a user’s home location with higher accuracy than direct per-tweet prediction?
  • RQ5How do different data splits and metadata availability levels affect model generalization across global and regional geolocation tasks?

Key findings

  • The model achieves a median geolocation error of fewer than 30 km on a worldwide-level dataset and under 15 km on the US-level dataset.
  • The proposed lower bound on GMM covariance ($\sigma_{\widehat{c}} \geq \frac{1}{2\pi}$) prevents the negative log-likelihood loss from becoming unstable and improves spatial accuracy.
  • Multitask learning with joint regression and GMM output leads to significant performance gains, especially when metadata is available.
  • The per-user home location prediction task outperforms per-tweet prediction in spatial accuracy, indicating that distributional modeling of multiple tweets per user enhances inference.
  • Datasets with complete metadata (e.g., local reproductions) yield significantly better results than those with missing 'place' metadata, such as the GeoText dataset.
  • The model demonstrates robustness across different geographic scales and supports flexible geographical granularity through customizable model adaptation.
Figure 2 : Squared Euclidean Distance ( SED ) function surface on the axes of $\Delta Y_{lon}$ and $\Delta Y_{lat}$ as the error distances per longitude and latitude axes; upper horizontal gray surface indicates the empirical maximum of $L_{spat}$ ; red line indicates the strict minimum of 0 implied
Figure 2 : Squared Euclidean Distance ( SED ) function surface on the axes of $\Delta Y_{lon}$ and $\Delta Y_{lat}$ as the error distances per longitude and latitude axes; upper horizontal gray surface indicates the empirical maximum of $L_{spat}$ ; red line indicates the strict minimum of 0 implied

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.