TwHIN-BERT is a new multi-lingual Tweet language model that is trained on 7 billion Tweets from over 100 distinct languages. TwHIN-BERT differs from prior pre-trained language models as it is trained with not only text-based self-supervision (e.g., MLM), but also with a social objective based on the rich social engagements within a Twitter Heterogeneous Information Network (TwHIN).
TwHIN-BERT can be used as a drop-in replacement for BERT in a variety of NLP and recommendation tasks. It not only outperforms similar models semantic understanding tasks such text classification), but also social recommendation tasks such as predicting user to Tweet engagement.
We initially release two pretrained TwHIN-BERT models (base and large) that are compatible wit the
HuggingFace BERT models.
1from transformers import AutoTokenizer, AutoModel
2tokenizer = AutoTokenizer.from_pretrained('Twitter/twhin-bert-base')
3model = AutoModel.from_pretrained('Twitter/twhin-bert-base')
4inputs = tokenizer("I'm using TwHIN-BERT! #TwHIN-BERT #NLP", return_tensors="pt")
5outputs = model(**inputs)
1@article{zhang2022twhin,
2 title={TwHIN-BERT: A Socially-Enriched Pre-trained Language Model for Multilingual Tweet Representations},
3 author={Zhang, Xinyang and Malkov, Yury and Florez, Omar and Park, Serim and McWilliams, Brian and Han, Jiawei and El-Kishky, Ahmed},
4 journal={arXiv preprint arXiv:2209.07562},
5 year={2022}
6}