Does the BERT model choose only the inputs it needs?

Hi, I am a new user of Transformers and I have successfully fine-tuned a BERT model following the tutorial.

However, I have one question about the features I send to the Trainer and those accepted by the BERT model.

Specifically, my original dataset contains two columns named “text” and “label”. After tokenizing the “text”, the dataset object now have three more columns named “input_ids”, “token_type_ids”, and “attention_mask”. I understand that these three columns are required by the BERT model, but I didn’t drop the original “text” column when I fed the dataset to the Trainer API.

So my question is, does BERT automatically ignore non-relevant features? (maybe this is achieved quietly by the Trainer API) Or should I remove these columns, leaving only “input_ids”, “token_type_ids”, and “attention_mask”?

Thank you!

The Trainer will ignore irrelevant columns in your input data.