往期文章链接目录
文章目录
BERT Recap
Overview
- Bert (Bidirectional Encoder Representations from Transformers) uses a “masked language model” to randomly mask some tokens from the input and predict the original vocabulary id of the masked token.
- Bert shows that “pre-trained representations reduce the need for many heavily-engineered task-specific architectures”.
BERT Specifics
There are two steps to the BERT framework: pre-training and fine-tuning
-
During pre training, the model is trained on unlabeled data over different pre-training tasks.
-
Each down stream task has separate fine-tuned models after each is first initialized with pre-trained parameters.
![](https://i-blog.csdnimg.cn/blog_migrate/fa9e38a124f53c9fa293ad2bdc0aaa1b.png)
Input Output Representations
-
In order to handle a variety of down-stream tasks, the input must be able to represent a single sentence and sentence pair in one sequence.
-
The first token of every sequence is always a classification token
[CLS]
. -
Sentence pairs are separated by a special token
[SEP]
. -
Learned embeddings are added to every token indication whether