A Hierarchical Location Prediction Neural Network for Twitter User Geolocation

Binxuan Huang, Kathleen M. CarleyEMNLP 2019 · DOI

TL;DR

This paper introduces a hierarchical neural network for predicting users' locations on Twitter, leveraging country-level predictions to guide city-level predictions. By incorporating text, metadata, and network features with a character-aware embedding layer, their model achieves state-of-the-art results across multiple benchmarks, significantly reducing prediction error.

What Problem Does This Paper Address?

Accurately pinpointing a user's location from their online activity, particularly on platforms like Twitter, is crucial for various applications, from recommendation systems to disaster management. While many methods exist, they often struggle with the inherent sparsity of geotagged data and the unreliability of self-declared locations. Existing neural network approaches, while powerful, tend to treat all locations equally, ignoring the natural hierarchical structure (e.g., country vs. city). This oversight is problematic because country-level prediction is generally easier and can provide valuable context for more granular city-level predictions. Furthermore, the noisy and informal nature of social media text poses a challenge for traditional text-based prediction methods.

Methods

The core of this paper is the Hierarchical Location Prediction Neural Network (HLPNN). The architecture is designed to first predict a user's country and then use that prediction to inform the city-level prediction.

Key methodological components include:

  • Character-Aware Word Embedding: To handle the noisy text in tweets, they employ a character-level convolutional neural network (CNN) to generate word embeddings. This helps capture sub-word information and overcome out-of-vocabulary words.
  • Hierarchical Prediction: The model first predicts the country probability. This country probability is then used as a constraint to guide the city-level prediction, ensuring that predicted cities are within the predicted country.
  • Feature Fusion: The model integrates multiple feature types:
  • Text Features: Personal description, profile location, and user name are processed using bidirectional LSTMs (Bi-LSTMs) and a word-level attention mechanism.
  • Metadata Features: User language and time zone are incorporated as learned embeddings.
  • Network Features: User mention networks are used to generate network embeddings.
  • Transformer Encoders: Several layers of transformer encoders are used to learn correlations between these diverse feature fields. A field-level attention mechanism is applied to weigh the importance of different features.
  • Loss Function: The model minimizes a combined cross-entropy loss for both country and city predictions, with a parameter to control the influence of country-level supervision.

Datasets

The authors evaluate their model on three widely adopted Twitter location prediction datasets:

  • Twitter-US: A dataset focused on North America, with ground truth locations derived from geotags and mapped to city categories.
  • Twitter-World: A global dataset containing only English tweets, making it more challenging.
  • WNUT: Released as part of a workshop on noisy user-generated text, this dataset also uses city centers as ground truth.

They also mention querying Twitter's API to augment these datasets with user metadata.

Key Insights and Ideas

  • Hierarchy Matters: The paper strongly suggests that exploiting the hierarchical structure of locations (country -> city) is beneficial and can significantly improve prediction accuracy and reduce errors.
  • Character-Level Embeddings are Crucial for Noisy Text: The character-aware word embedding layer proves effective in handling the informal and often misspelled text found on social media.
  • Feature Fusion is Powerful: Combining text, metadata, and network information leads to substantial performance gains, outperforming models that rely on a single feature type.
  • Country Supervision Guides City Prediction: Explicitly incorporating country-level predictions as a constraint for city-level prediction helps to avoid misplacing users in incorrect countries, leading to more accurate and sensible results.

Key Results

The HLPNN model achieves state-of-the-art results across all three datasets and under various feature settings.

  • Overall Performance: The full HLPNN model (Text+Meta+Net) outperforms previous methods in accuracy (Acc@161) and significantly reduces mean error distance on all datasets. For instance, on the challenging Twitter-World dataset, it increases Acc@161 by 4% and reduces mean error distance by about 400 kilometers compared to a strong neural model.
  • Text-Only Performance: Even when using only tweet text (HLPNN-Text), the model performs best among text-based systems, demonstrating the effectiveness of its character-aware embeddings and attention mechanisms.
  • Ablation Study: The ablation study highlights the importance of each component: character-level CNNs are crucial for noisy text, word-level attention provides a good gain, transformer encoders effectively learn feature correlations, and country supervision significantly improves performance.

Limitations and Future Work

  • Network Representation: While the model uses network embeddings, the authors suggest that more advanced graph-level classification frameworks could further enhance performance by propagating features from connected friends.
  • User Movement: The current model assumes a single home location for all posts, ignoring dynamic user movement patterns like traveling. Incorporating temporal states to capture location changes is a promising direction for future work.
  • Data Accessibility: The authors note that some user data was inaccessible due to Twitter's privacy policy changes, which could affect comparisons.

Summary updated

BibTeX
@inproceedings{huang2019hierarchical,
  author = {Binxuan Huang and Kathleen M. Carley},
  title = {{A Hierarchical Location Prediction Neural Network for Twitter User Geolocation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1480},
}
Figure