microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
20.19k stars 2.55k forks source link

Documenting id2label and label2id arguments in `LayoutLMv3ForTokenClassification.from_pretrained` #1485

Open matsuobasho opened 8 months ago

matsuobasho commented 8 months ago

Describe the bug I'm using LayoutLMv3 through the transformers package. My question is about documentation.

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Run the following:
    
    from transformers import LayoutLMv3ForTokenClassification

model = LayoutLMv3ForTokenClassification.from_pretrained("microsoft/layoutlmv3-base", id2label=id2label, label2id=label2id)


Which I'm getting from a [tutorial](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb)

**Expected behavior**
I would like to see where the id2label and label2id arguments are documented.  When I click docs for `LayoutLMv3ForTokenClassification.from_pretrained`, I see *model_args and **kwargs, but don't know where to read descriptions about the arguments mentioned above. 

On the HuggingFace page for [LayoutLM](https://huggingface.co/docs/transformers/v4.21.1/en/model_doc/layoutlmv3#transformers.LayoutLMv3Model), the link is to the generic `from_pretrained` method.