abhishekkrthakur / bert-sentiment

MIT License
269 stars 101 forks source link

Reduction of superfluous code for padding #3

Closed 10-zin closed 4 years ago

10-zin commented 4 years ago

The encode_plus() function accepts pad_to_max_length as an argument. If it is set to true, the input is encoded with automatic padding for ids, mask and token type ids. This can shorten 4 lines of extra code in the BERTDataset class to 1.

abhishekkrthakur commented 4 years ago

Great. I didnt know this existed :D Merged!