Views
No views yet
fill-mask task (see below). You can also use the model without the MLM/NSP heads and train a classifier with it.1from transformers import pipeline
2import json
3
4pipe = pipeline(task='fill-mask', model='digitalepidemiologylab/covid-twitter-bert-v2')
5out = pipe(f"In places with a lot of people, it's a good idea to wear a {pipe.tokenizer.mask_token}")
6print(json.dumps(out, indent=4))
7[
8 {
9 "sequence": "[CLS] in places with a lot of people, it's a good idea to wear a mask [SEP]",
10 "score": 0.9998226761817932,
11 "token": 7308,
12 "token_str": "mask"
13 },
14 ...
15]1@article{muller2020covid,
2 title={COVID-Twitter-BERT: A Natural Language Processing Model to Analyse COVID-19 Content on Twitter},
3 author={M{\"u}ller, Martin and Salath{\'e}, Marcel and Kummervold, Per E},
4 journal={arXiv preprint arXiv:2005.07503},
5 year={2020}
6}1COVID-Twitter-BERT: A Natural Language Processing Model to Analyse COVID-19 Content on Twitter.
2arXiv preprint arXiv:2005.07503 (2020).