Unverified Commit 78a53d59 authored by Maria Khalusova's avatar Maria Khalusova Committed by GitHub
Browse files

Adding task guides to resources (#21704)



* added resources: links to task guides that support these models

* minor polishing

* conflict resolved

* link fix

* Update docs/source/en/model_doc/vision-encoder-decoder.mdx
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>

---------
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
parent 03aaac35
...@@ -73,7 +73,9 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -73,7 +73,9 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- [`GPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#gpt-2gpt-and-causal-language-modeling), [text generation example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-generation), and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb). - [`GPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling#gpt-2gpt-and-causal-language-modeling), [text generation example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/text-generation), and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb).
- [`TFGPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb). - [`TFGPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb).
- [`FlaxGPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#causal-language-modeling) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/causal_language_modeling_flax.ipynb). - [`FlaxGPT2LMHeadModel`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#causal-language-modeling) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/causal_language_modeling_flax.ipynb).
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Causal language modeling task guide](./tasks/language_modeling)
## GPT2Config ## GPT2Config
......
...@@ -50,6 +50,11 @@ The `generate()` method can be used to generate text using GPT Neo model. ...@@ -50,6 +50,11 @@ The `generate()` method can be used to generate text using GPT Neo model.
>>> gen_text = tokenizer.batch_decode(gen_tokens)[0] >>> gen_text = tokenizer.batch_decode(gen_tokens)[0]
``` ```
## Documentation resources
- [Text classification task guide](./tasks/sequence_classification)
- [Causal language modeling task guide](./tasks/language_modeling)
## GPTNeoConfig ## GPTNeoConfig
[[autodoc]] GPTNeoConfig [[autodoc]] GPTNeoConfig
......
...@@ -57,6 +57,10 @@ The `generate()` method can be used to generate text using GPT Neo model. ...@@ -57,6 +57,10 @@ The `generate()` method can be used to generate text using GPT Neo model.
>>> gen_text = tokenizer.batch_decode(gen_tokens)[0] >>> gen_text = tokenizer.batch_decode(gen_tokens)[0]
``` ```
## Documentation resources
- [Causal language modeling task guide](./tasks/language_modeling)
## GPTNeoXConfig ## GPTNeoXConfig
[[autodoc]] GPTNeoXConfig [[autodoc]] GPTNeoXConfig
......
...@@ -47,6 +47,10 @@ The `generate()` method can be used to generate text using GPT NeoX Japanese mod ...@@ -47,6 +47,10 @@ The `generate()` method can be used to generate text using GPT NeoX Japanese mod
人とAIが協調するためには、AIと人が共存し、AIを正しく理解する必要があります。 人とAIが協調するためには、AIと人が共存し、AIを正しく理解する必要があります。
``` ```
## Documentation resources
- [Causal language modeling task guide](./tasks/language_modeling)
## GPTNeoXJapaneseConfig ## GPTNeoXJapaneseConfig
[[autodoc]] GPTNeoXJapaneseConfig [[autodoc]] GPTNeoXJapaneseConfig
......
...@@ -122,6 +122,11 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -122,6 +122,11 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- [`TFGPTJForCausalLM`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb). - [`TFGPTJForCausalLM`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/tensorflow/language-modeling#run_clmpy) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb).
- [`FlaxGPTJForCausalLM`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#causal-language-modeling) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/causal_language_modeling_flax.ipynb). - [`FlaxGPTJForCausalLM`] is supported by this [causal language modeling example script](https://github.com/huggingface/transformers/tree/main/examples/flax/language-modeling#causal-language-modeling) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/causal_language_modeling_flax.ipynb).
**Documentation resources**
- [Text classification task guide](./tasks/sequence_classification)
- [Question answering task guide](./tasks/question_answering)
- [Causal language modeling task guide](./tasks/language_modeling)
## GPTJConfig ## GPTJConfig
[[autodoc]] GPTJConfig [[autodoc]] GPTJConfig
......
...@@ -40,6 +40,10 @@ Tips: ...@@ -40,6 +40,10 @@ Tips:
This model was contributed by [patrickvonplaten](https://huggingface.co/patrickvonplaten). This model was contributed by [patrickvonplaten](https://huggingface.co/patrickvonplaten).
## Documentation resources
- [Audio classification task guide](./tasks/audio_classification)
- [Automatic speech recognition task guide](./tasks/asr)
## HubertConfig ## HubertConfig
......
...@@ -36,6 +36,13 @@ been open-sourced.* ...@@ -36,6 +36,13 @@ been open-sourced.*
This model was contributed by [kssteven](https://huggingface.co/kssteven). The original code can be found [here](https://github.com/kssteven418/I-BERT). This model was contributed by [kssteven](https://huggingface.co/kssteven). The original code can be found [here](https://github.com/kssteven418/I-BERT).
## Documentation resources
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Question answering task guide](./tasks/question_answering)
- [Masked language modeling task guide](./tasks/masked_language_modeling)
- [Multiple choice task guide](./tasks/masked_language_modeling)
## IBertConfig ## IBertConfig
......
...@@ -77,6 +77,7 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -77,6 +77,7 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- Demo notebooks for ImageGPT can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/ImageGPT). - Demo notebooks for ImageGPT can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/ImageGPT).
- [`ImageGPTForImageClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb). - [`ImageGPTForImageClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb).
- See also: [Image classification task guide](./tasks/image_classification)
If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.
......
...@@ -88,13 +88,20 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -88,13 +88,20 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- A notebook on how to [fine-tune LayoutLM on the FUNSD dataset with image embeddings](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Add_image_embeddings_to_LayoutLM.ipynb). - A notebook on how to [fine-tune LayoutLM on the FUNSD dataset with image embeddings](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Add_image_embeddings_to_LayoutLM.ipynb).
- See also: [Document question answering task guide](./tasks/document_question_answering)
<PipelineTag pipeline="text-classification" /> <PipelineTag pipeline="text-classification" />
- A notebook on how to [fine-tune LayoutLM for sequence classification on the RVL-CDIP dataset](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Fine_tuning_LayoutLMForSequenceClassification_on_RVL_CDIP.ipynb). - A notebook on how to [fine-tune LayoutLM for sequence classification on the RVL-CDIP dataset](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Fine_tuning_LayoutLMForSequenceClassification_on_RVL_CDIP.ipynb).
- [Text classification task guide](./tasks/sequence_classification)
<PipelineTag pipeline="token-classification" /> <PipelineTag pipeline="token-classification" />
- A notebook on how to [ fine-tune LayoutLM for token classification on the FUNSD dataset](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Fine_tuning_LayoutLMForTokenClassification_on_FUNSD.ipynb). - A notebook on how to [ fine-tune LayoutLM for token classification on the FUNSD dataset](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Fine_tuning_LayoutLMForTokenClassification_on_FUNSD.ipynb).
- [Token classification task guide](./tasks/token_classification)
**Other resources**
- [Masked language modeling task guide](./tasks/masked_language_modeling)
🚀 Deploy 🚀 Deploy
......
...@@ -266,6 +266,13 @@ print(encoding.keys()) ...@@ -266,6 +266,13 @@ print(encoding.keys())
# dict_keys(['input_ids', 'token_type_ids', 'attention_mask', 'bbox', 'image']) # dict_keys(['input_ids', 'token_type_ids', 'attention_mask', 'bbox', 'image'])
``` ```
## Documentation resources
- [Document question answering task guide](./tasks/document_question_answering)
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Question answering task guide](./tasks/question_answering)
## LayoutLMv2Config ## LayoutLMv2Config
[[autodoc]] LayoutLMv2Config [[autodoc]] LayoutLMv2Config
......
...@@ -52,17 +52,22 @@ LayoutLMv3 is nearly identical to LayoutLMv2, so we've also included LayoutLMv2 ...@@ -52,17 +52,22 @@ LayoutLMv3 is nearly identical to LayoutLMv2, so we've also included LayoutLMv2
<PipelineTag pipeline="text-classification"/> <PipelineTag pipeline="text-classification"/>
- [`LayoutLMv2ForSequenceClassification`] is supported by this [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/RVL-CDIP/Fine_tuning_LayoutLMv2ForSequenceClassification_on_RVL_CDIP.ipynb). - [`LayoutLMv2ForSequenceClassification`] is supported by this [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/RVL-CDIP/Fine_tuning_LayoutLMv2ForSequenceClassification_on_RVL_CDIP.ipynb).
- [Text classification task guide](./tasks/sequence_classification)
<PipelineTag pipeline="token-classification"/> <PipelineTag pipeline="token-classification"/>
- [`LayoutLMv3ForTokenClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/research_projects/layoutlmv3) and [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb). - [`LayoutLMv3ForTokenClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/research_projects/layoutlmv3) and [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb).
- A [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/Inference_with_LayoutLMv2ForTokenClassification.ipynb) for how to perform inference with [`LayoutLMv2ForTokenClassification`] and a [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/True_inference_with_LayoutLMv2ForTokenClassification_%2B_Gradio_demo.ipynb) for how to perform inference when no labels are available with [`LayoutLMv2ForTokenClassification`]. - A [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/Inference_with_LayoutLMv2ForTokenClassification.ipynb) for how to perform inference with [`LayoutLMv2ForTokenClassification`] and a [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/True_inference_with_LayoutLMv2ForTokenClassification_%2B_Gradio_demo.ipynb) for how to perform inference when no labels are available with [`LayoutLMv2ForTokenClassification`].
- A [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/Fine_tuning_LayoutLMv2ForTokenClassification_on_FUNSD_using_HuggingFace_Trainer.ipynb) for how to finetune [`LayoutLMv2ForTokenClassification`] with the 🤗 Trainer. - A [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/Fine_tuning_LayoutLMv2ForTokenClassification_on_FUNSD_using_HuggingFace_Trainer.ipynb) for how to finetune [`LayoutLMv2ForTokenClassification`] with the 🤗 Trainer.
- [Token classification task guide](./tasks/token_classification)
<PipelineTag pipeline="question-answering"/> <PipelineTag pipeline="question-answering"/>
- [`LayoutLMv2ForQuestionAnswering`] is supported by this [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/DocVQA/Fine_tuning_LayoutLMv2ForQuestionAnswering_on_DocVQA.ipynb). - [`LayoutLMv2ForQuestionAnswering`] is supported by this [notebook](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/DocVQA/Fine_tuning_LayoutLMv2ForQuestionAnswering_on_DocVQA.ipynb).
- [Question answering task guide](./tasks/question_answering)
**Document question answering**
- [Document question answering task guide](./tasks/document_question_answering)
## LayoutLMv3Config ## LayoutLMv3Config
......
...@@ -55,6 +55,12 @@ Tips: ...@@ -55,6 +55,12 @@ Tips:
This model was contributed by [patrickvonplaten](https://huggingface.co/patrickvonplaten). This model was contributed by [patrickvonplaten](https://huggingface.co/patrickvonplaten).
## Documentation resources
- [Text classification task guide](./tasks/sequence_classification)
- [Question answering task guide](./tasks/question_answering)
- [Translation task guide](./tasks/translation)
- [Summarization task guide](./tasks/summarization)
## LEDConfig ## LEDConfig
......
...@@ -68,6 +68,7 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -68,6 +68,7 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
<PipelineTag pipeline="image-classification"/> <PipelineTag pipeline="image-classification"/>
- [`LevitForImageClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb). - [`LevitForImageClassification`] is supported by this [example script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb).
- See also: [Image classification task guide](./tasks/image_classification)
If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.
......
...@@ -52,6 +52,11 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h ...@@ -52,6 +52,11 @@ A list of official Hugging Face and community (indicated by 🌎) resources to h
- Demo notebooks for LiLT can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LiLT). - Demo notebooks for LiLT can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LiLT).
**Documentation resources**
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Question answering task guide](./tasks/question_answering)
If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.
## LiltConfig ## LiltConfig
......
...@@ -89,6 +89,14 @@ mlm_labels = tokenizer.encode("This is a sentence from the training data", retur ...@@ -89,6 +89,14 @@ mlm_labels = tokenizer.encode("This is a sentence from the training data", retur
loss = model(input_ids, labels=input_ids, masked_lm_labels=mlm_labels)[0] loss = model(input_ids, labels=input_ids, masked_lm_labels=mlm_labels)[0]
``` ```
## Documentation resources
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Question answering task guide](./tasks/question_answering)
- [Masked language modeling task guide](./tasks/masked_language_modeling)
- [Multiple choice task guide](./tasks/multiple_choice)
## LongformerConfig ## LongformerConfig
[[autodoc]] LongformerConfig [[autodoc]] LongformerConfig
......
...@@ -86,6 +86,10 @@ The complexity of this mechanism is `O(l(r + l/k))`. ...@@ -86,6 +86,10 @@ The complexity of this mechanism is `O(l(r + l/k))`.
This model was contributed by [stancld](https://huggingface.co/stancld). This model was contributed by [stancld](https://huggingface.co/stancld).
The original code can be found [here](https://github.com/google-research/longt5). The original code can be found [here](https://github.com/google-research/longt5).
## Documentation resources
- [Translation task guide](./tasks/translation)
- [Summarization task guide](./tasks/summarization)
## LongT5Config ## LongT5Config
......
...@@ -117,6 +117,13 @@ Example: ...@@ -117,6 +117,13 @@ Example:
This model was contributed by [ikuyamada](https://huggingface.co/ikuyamada) and [nielsr](https://huggingface.co/nielsr). The original code can be found [here](https://github.com/studio-ousia/luke). This model was contributed by [ikuyamada](https://huggingface.co/ikuyamada) and [nielsr](https://huggingface.co/nielsr). The original code can be found [here](https://github.com/studio-ousia/luke).
## Documentation resources
- [Text classification task guide](./tasks/sequence_classification)
- [Token classification task guide](./tasks/token_classification)
- [Question answering task guide](./tasks/question_answering)
- [Masked language modeling task guide](./tasks/masked_language_modeling)
- [Multiple choice task guide](./tasks/multiple_choice)
## LukeConfig ## LukeConfig
......
...@@ -51,6 +51,9 @@ Tips: ...@@ -51,6 +51,9 @@ Tips:
This model was contributed by [eltoto1219](https://huggingface.co/eltoto1219). The original code can be found [here](https://github.com/airsplay/lxmert). This model was contributed by [eltoto1219](https://huggingface.co/eltoto1219). The original code can be found [here](https://github.com/airsplay/lxmert).
## Documentation resources
- [Question answering task guide](./tasks/question_answering)
## LxmertConfig ## LxmertConfig
......
...@@ -91,6 +91,11 @@ loss = model(**model_inputs).loss # forward pass ...@@ -91,6 +91,11 @@ loss = model(**model_inputs).loss # forward pass
"Life is like a box of chocolate." "Life is like a box of chocolate."
``` ```
## Documentation resources
- [Translation task guide](./tasks/translation)
- [Summarization task guide](./tasks/summarization)
## M2M100Config ## M2M100Config
[[autodoc]] M2M100Config [[autodoc]] M2M100Config
......
...@@ -161,6 +161,12 @@ Example of translating english to many romance languages, using old-style 2 char ...@@ -161,6 +161,12 @@ Example of translating english to many romance languages, using old-style 2 char
'Y esto al español'] 'Y esto al español']
``` ```
## Documentation resources
- [Translation task guide](./tasks/translation)
- [Summarization task guide](./tasks/summarization)
- [Causal language modeling task guide](./tasks/language_modeling)
## MarianConfig ## MarianConfig
[[autodoc]] MarianConfig [[autodoc]] MarianConfig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment