Improving Tweet Representations Using Temporal and User Context

Ganesh J, Manish Gupta, Vasudeva Varma

TL;DR

Researchers have developed a novel representation learning model that improves tweet embeddings by looking beyond the individual post. By incorporating a user's chronologically adjacent tweets (temporal context) and a learned "user profile" vector, and then applying an attention mechanism to weight the most relevant context, the model significantly outperforms standard document-embedding techniques in predicting user attributes.

What Problem Does This Paper Address?

Tweets are notoriously difficult for Natural Language Processing (NLP) models to handle. They are short, noisy, and often lack sufficient internal context to generate accurate latent representations (embeddings). Standard document-level models like Paragraph2Vec (Doc2Vec) tend to overfit on tweets because there simply isn't enough text to learn a robust signal.

The authors argue that a tweet shouldn't be modeled in a vacuum. On Twitter, a user’s timeline often follows a thematic thread. If a user posts about "Climate Change," their previous and subsequent tweets are likely related. However, not all adjacent tweets are relevant—a user might sandwich a tweet about a global crisis between two posts about what they had for lunch. The challenge is to leverage this surrounding context while filtering out the "noise" of irrelevant adjacent posts.

Methods

The authors propose a hierarchical model consisting of two main components:

  1. Word Context Model: A standard approach that learns tweet representations by predicting the words within the tweet.
  2. User + Tweet Context Model: This is the core innovation. It enriches the tweet representation using:
  3. Temporal Context: It looks at a window of $C_T$ tweets before and after the target tweet.
  4. Attention Mechanism: Instead of treating all neighboring tweets as equally important (as previous models like HDV did), this model learns "attention weights" ($\alpha$). It uses back-propagation to determine which context tweets are semantically similar to the target and assigns them higher weights.
  5. User Context: The model learns a specific vector ($u(k)$) for each user. This vector captures the user's unique writing style and the general topics they frequent, making the model "user-aware."

The model is trained using hierarchical softmax to maintain efficiency and optimized using the Adam optimizer.

Datasets

The study utilized a publicly available dataset (Li et al., 2014) containing tweets from 1,600 users. The dataset is labeled for three specific user profile attributes:

  • Spouse (e.g., tweets indicating marital status)
  • Education
  • Job

The researchers used a 70-10-20 split for training, validation, and testing. Word embeddings were initialized using pre-trained GloVe vectors.

Key Insights and Ideas

  • Context is King, but Attention is the Guard: The "aha moment" here is that while temporal context helps, naive inclusion of adjacent tweets is sub-optimal. The attention mechanism successfully identifies that a tweet about "Alaska" is more relevant to a "Climate Change" target tweet than a tweet about "overtime rules," even if both are in the same timeline.
  • User Identity Matters: Learning a latent vector for the user helps the model understand the "source" of the text. This is particularly effective for attributes like "Job" or "Education," where a user's overall vocabulary and topical interests are consistent over time.
  • Overcoming Sparsity: By effectively "borrowing" signal from the user's history, the model compensates for the extreme brevity of a single 140-character (at the time) tweet.

Key Results

The proposed model was evaluated on its ability to classify user profile attributes using a linear SVM. It was compared against baselines like Paragraph2Vec and HDV (Hierarchical Document Vector).

  • Spouse Prediction: Improved F1-score by 19.66% over the best baseline.
  • Education Prediction: Improved F1-score by 2.27%.
  • Job Prediction: Improved F1-score by 2.22%.

Interestingly, the "User-Aware" version of the model performed best for Education and Job, but the version without the user vector performed better for the Spouse attribute. The authors suggest this is because "Spouse" related tweets often involve sudden topic shifts that the general user vector might actually obscure.

Limitations and Future Work

  • Topic Shifts: The model still struggles when a user's timeline undergoes rapid, unrelated topic changes, as seen in the "Spouse" attribute results.
  • User Vector Accuracy: The authors noted that in some cases, the learned user vector was less accurate than expected, likely due to the diversity of topics a single user might tweet about.
  • Future Directions: The researchers plan to explore the broader application potential of these learned user vectors in other NLP tasks and further refine how user characteristics are modeled to handle high-variance timelines.

Summary updated

BibTeX
@inproceedings{j2017improving,
  author = {Ganesh J and Manish Gupta and Vasudeva Varma},
  title = {{Improving Tweet Representations Using Temporal and User Context}},
  booktitle = {ECIR},
  year = {2017},
  doi = {10.1007/978-3-319-56608-5\_51},
}
Figure