transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Issue: Possibly wrong documentation about labels in BERT classifier

Open domaala opened this issue 7 years ago • 1 comments

Possibly also elsewhere, but when discussing the proper format of labels for BERT classification, the documentation states the following:

https://github.com/huggingface/pytorch-transformers/blob/44dd941efb602433b7edc29612cbdd0a03bf14dc/pytorch_transformers/modeling_bert.py#L935

However, shouldn't it be [0, ..., config.num_labels - 1]? After all, CrossEntropyLoss is being used here.

domaala avatar Aug 06 '19 14:08 domaala

Indeed. @LysandreJik I think it should be Indices should be in ``[0, ..., config.num_labels-1]`` for classification or torch.floats for regression, what do you think?

thomwolf avatar Aug 07 '19 08:08 thomwolf