Transformers-Tutorials icon indicating copy to clipboard operation
Transformers-Tutorials copied to clipboard

Why do you need custom Features?

Open gordon-lim opened this issue 2 months ago • 1 comments

Why do we need the following in the Fine-tuning LayoutLMv2ForSequenceClassification on RVL-CDIP notebook?

# we need to define custom features
features = Features({
    'image': Array3D(dtype="int64", shape=(3, 224, 224)),
    'input_ids': Sequence(feature=Value(dtype='int64')),
    'attention_mask': Sequence(Value(dtype='int64')),
    'token_type_ids': Sequence(Value(dtype='int64')),
    'bbox': Array2D(dtype="int64", shape=(512, 4)),
    'labels': ClassLabel(num_classes=len(labels), names=labels),
})

gordon-lim avatar Jun 19 '24 16:06 gordon-lim