From 34cf67fd6c3690bdc02d15cbc44da272b938c330 Mon Sep 17 00:00:00 2001 From: Martin Boyanov Date: Fri, 12 Apr 2019 21:30:28 +0300 Subject: [PATCH] Extend the BertForSequenceClassification docs to mention the special CLS token. --- pytorch_pretrained_bert/modeling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_pretrained_bert/modeling.py b/pytorch_pretrained_bert/modeling.py index 2736e34d7f..037c6e9723 100644 --- a/pytorch_pretrained_bert/modeling.py +++ b/pytorch_pretrained_bert/modeling.py @@ -930,7 +930,7 @@ class BertForSequenceClassification(BertPreTrainedModel): Inputs: `input_ids`: a torch.LongTensor of shape [batch_size, sequence_length] - with the word token indices in the vocabulary(see the tokens preprocessing logic in the scripts + with the word token indices in the vocabulary. Items in the batch should begin with the special "CLS" token. (see the tokens preprocessing logic in the scripts `extract_features.py`, `run_classifier.py` and `run_squad.py`) `token_type_ids`: an optional torch.LongTensor of shape [batch_size, sequence_length] with the token types indices selected in [0, 1]. Type 0 corresponds to a `sentence A` and type 1 corresponds to