BERT的输入中,[CLS]和[SEP]应该被放在哪?

 

Token embeddings: A [CLS] token is added to the input word tokens at the beginning of the first sentence and a [SEP] token is inserted at the end of each sentence.

之前以为每个句子都会插入一对【CLS】和【SEP】,于是就有了第一句的【SEP】和第二句的【CLS】怎么处理的疑惑,现在看来,在多个句子里,【CLS】只在最前面插入一次,后面每个句子都插入一个【SEP】。不过,这个应该是指一次输入,对于第二次输入,应该也会在输入开头插入【CLS】。

 

【link】

posted @ 2022-04-19 17:45  Hisi  阅读(784)  评论(0编辑  收藏  举报