dqnguyen commited on
Commit
fd00afc
1 Parent(s): 8e9cac4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -61
README.md CHANGED
@@ -14,64 +14,3 @@ BERTweet is the first public large-scale language model pre-trained for English
14
 
15
  For further information or requests, please go to [BERTweet's homepage](https://github.com/VinAIResearch/BERTweet)!
16
 
17
- ### <a name="models2"></a> Pre-trained models
18
-
19
-
20
- Model | #params | Arch. | Pre-training data
21
- ---|---|---|---
22
- `vinai/bertweet-base` | 135M | base | 850M English Tweets (cased)
23
- `vinai/bertweet-covid19-base-cased` | 135M | base | 23M COVID-19 English Tweets (cased)
24
- `vinai/bertweet-covid19-base-uncased` | 135M | base | 23M COVID-19 English Tweets (uncased)
25
- `vinai/bertweet-large` | 355M | large | 873M English Tweets (cased)
26
-
27
- Two pre-trained models `vinai/bertweet-covid19-base-cased` and `vinai/bertweet-covid19-base-uncased` are resulted by further pre-training the pre-trained model `vinai/bertweet-base` on a corpus of 23M COVID-19 English Tweets.
28
-
29
- ### <a name="usage2"></a> Example usage
30
-
31
-
32
- ```python
33
- import torch
34
- from transformers import AutoModel, AutoTokenizer
35
-
36
- bertweet = AutoModel.from_pretrained("vinai/bertweet-covid19-base-uncased")
37
-
38
- # For transformers v4.x+:
39
- tokenizer = AutoTokenizer.from_pretrained("vinai/bertweet-covid19-base-uncased", use_fast=False)
40
-
41
- # For transformers v3.x:
42
- # tokenizer = AutoTokenizer.from_pretrained("vinai/bertweet-covid19-base-uncased")
43
-
44
- # INPUT TWEET IS ALREADY NORMALIZED!
45
- line = "SC has first two presumptive cases of coronavirus , DHEC confirms HTTPURL via @USER :crying_face:"
46
-
47
- input_ids = torch.tensor([tokenizer.encode(line)])
48
-
49
- with torch.no_grad():
50
- features = bertweet(input_ids) # Models outputs are now tuples
51
-
52
- ## With TensorFlow 2.0+:
53
- # from transformers import TFAutoModel
54
- # bertweet = TFAutoModel.from_pretrained("vinai/bertweet-covid19-base-uncased")
55
- ```
56
-
57
- ### <a name="preprocess"></a> Normalize raw input Tweets
58
-
59
- Before applying `fastBPE` to the pre-training corpus of 850M English Tweets, we tokenized these Tweets using `TweetTokenizer` from the NLTK toolkit and used the `emoji` package to translate emotion icons into text strings (here, each icon is referred to as a word token). We also normalized the Tweets by converting user mentions and web/url links into special tokens `@USER` and `HTTPURL`, respectively. Thus it is recommended to also apply the same pre-processing step for BERTweet-based downstream applications w.r.t. the raw input Tweets. BERTweet provides this pre-processing step by enabling the `normalization` argument. This argument currently only supports models "`vinai/bertweet-base`", "`vinai/bertweet-covid19-base-cased`" and "`vinai/bertweet-covid19-base-uncased`".
60
-
61
- - Install `emoji`: `pip3 install emoji==0.6.0`
62
- - The `emoji` version must be either 0.5.4 or 0.6.0. Newer `emoji` versions have been updated to newer versions of the Emoji Charts, thus not consistent with the one used for pre-processing our pre-training Tweet corpus.
63
-
64
- ```python
65
- import torch
66
- from transformers import AutoTokenizer
67
-
68
- # Load the AutoTokenizer with a normalization mode if the input Tweet is raw
69
- tokenizer = AutoTokenizer.from_pretrained("vinai/bertweet-covid19-base-uncased", normalization=True)
70
-
71
- # from transformers import BertweetTokenizer
72
- # tokenizer = BertweetTokenizer.from_pretrained("vinai/bertweet-covid19-base-uncased", normalization=True)
73
-
74
- line = "SC has first two presumptive cases of coronavirus, DHEC confirms https://postandcourier.com/health/covid19/sc-has-first-two-presumptive-cases-of-coronavirus-dhec-confirms/article_bddfe4ae-5fd3-11ea-9ce4-5f495366cee6.html?utm_medium=social&utm_source=twitter&utm_campaign=user-share… via @postandcourier"
75
-
76
- input_ids = torch.tensor([tokenizer.encode(line)])
77
- ```
14
 
15
  For further information or requests, please go to [BERTweet's homepage](https://github.com/VinAIResearch/BERTweet)!
16