Abstract
Text from social media provides a set of challenges that can cause traditional NLP approaches to fail. Informal language, spelling errors, abbreviations, and special characters are all commonplace in these posts, leading to a prohibitively large vocabulary size for word-level approaches. We propose a character composition model, tweet2vec, which finds vector-space representations of whole tweets by learning complex, non-local dependencies in character sequences. The proposed model outperforms a word-level baseline at predicting user-annotated hashtags associated with the posts, doing significantly better when the input contains many out-of-vocabulary words or unusual character sequences. Our tweet2vec encoder is publicly available.
Introduction
Traditional Natural Language Processing (NLP) models often treat words as the fundamental units of language. However, social media text is notoriously "noisy." Users frequently use non-standard spellings (e.g., "sleeeeeeep"), abbreviations, and emojis. This creates two major hurdles for word-level models: the Vocabulary Explosion, where millions of unique word types make memory-intensive demands, and the "UNK" Problem, where rare or unseen words are grouped into a single "Unknown" token, discarding their semantic meaning.
Tweet2Vec addresses these issues by processing text character-by-character rather than word-by-word. This approach allows the model to effectively handle the slang, typos, and emojis prevalent on Twitter, mapping noisy posts into a continuous vector space.
Methodology
The core of Tweet2Vec is a compositional model that builds tweet representations from the ground up using characters.
As shown in the architecture above, the model utilizes a Bi-directional Gated Recurrent Unit (Bi-GRU). One GRU processes the character sequence forward, while another processes it backward. The final states of both GRUs are combined through a fully connected layer to produce a fixed-length "tweet embedding."
Unlike unsupervised models like Word2Vec, Tweet2Vec is trained using supervision from hashtags. By learning to predict the hashtags users originally assigned to their tweets, the model ensures that tweets with similar semantic intent have embeddings that are close to each other in vector space. The model accepts a wide Unicode character set, allowing it to interpret whitespace, punctuation, and emojis as distinct signals.
Experimental Setup
The researchers evaluated the model using a massive dataset of global Twitter posts collected over one week in June 2013. The dataset consisted of 2 million tweets for training, 10k for validation, and 50k for testing. The study focused on English posts with at least one hashtag, filtering for 2,039 distinct hashtags that appeared between 500 and 19,000 times to avoid extremely rare or automated spam labels.
Key Results
Tweet2Vec consistently outperformed a word-level Bi-GRU baseline across several metrics. On the full test set, Tweet2Vec achieved a Precision@1 of 28.4% compared to the word model's 24.1%.
The most striking difference appeared in the "Rare Words" test set—tweets containing many words outside the top 20,000 vocabulary. In this scenario, Tweet2Vec achieved 32.9% Precision@1, while the word model's performance plummeted to 20.4%. This highlights the model's robustness to orthographic variations; for example, it correctly predicted #insomnia for the tweet "can't sleeeeeeep" by recognizing the underlying character sequence, whereas a word model would treat the misspelled word as an unknown token.
Discussion and Future Work
While character-level modeling offers superior robustness, it comes with a higher computational cost. Because character sequences are significantly longer than word sequences, Tweet2Vec took roughly 6x longer per epoch to train than the word-level baseline.
Future work could expand this approach by incorporating a character-level decoder to generate new hashtags rather than selecting from a fixed list. Additionally, testing these embeddings on downstream tasks like sentiment analysis or real-time event tracking would further validate the utility of character-based distributed representations in social media contexts.
Summary updated