transformers
transformers copied to clipboard
Issue: Possibly wrong documentation about labels in BERT classifier
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.
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?