How to fine-tune NLP tasks docs
Author: stevhliu
Pull request: yes
Labels: name: Documentation

This PR focuses on adding guides for how-to fine-tune models for NLP tasks. Main additions:

- Change the TOC structure to include a nested section in the how-to guides for fine-tuning for NLP tasks.
- Separate each task in `custom_datasets` into their own pages. This will make it easier for users to find and read about a specific one. Also, when you click on any of the subsections that share the same name (`Preprocess`, `Fine-tune with Trainer API`, and `Fine-tune with TensorFlow`), you are automatically redirected to the sequence classification section even if you wanted to look at the question answering section.
- Add a guide for causal/masked language modeling.

To do:
- [x] Add guides for multiple choice, translation and summarization.

Comments:
_The documentation is not available anymore as the PR was closed or merged._

Thanks for the review! 

I've added videos where they're relevant and links to the base fine-tuning tutorials. About the subfolders, I was going to create one for each modality so users can easily sort for the type of guide they're looking for. If you don't think this is too impactful (I guess it does add additional subfolders which can make navigation harder), I'm happy with your suggestion!

I don't think we need the extra-layer of subfolders for the source doc. We can organize it by tasks in the ToC, but only contributors go look at the source.

I updated the causal language modeling example to also use `DataCollatorForLanguageModeling` instead of a `DefaultDataCollator` for consistency across both language modeling examples. Let me know if the example usage looks correct to you!

Thanks for the review, I'll merge this tomorrow if there are no other comments! Maybe we can add these to the doctests in a second step just because there are so many new examples, and it'd be easier to debug if something went wrong? No strong preference either way though :)

When I run `make fixup` it changes:

```
>>> @dataclass
... class DataCollatorForMultipleChoice:
```

to the example below which is causing the test to fail. Should I just drop the `>>>` and ellipses in this example?

```
>>> @dataclass
>>> class DataCollatorForMultipleChoice:
```

Yes, ok!

Can you identify which tool does that? If it's one of ours, it'd be nice to fix it; if it's not, it'd be nice to open an issue to the corresponding tool.

I think it might be this [line](https://github.com/huggingface/transformers/blob/57882177becb85560f1ff931abb1b0b75d67e70d/utils/style_doc.py#L176) in `utils/style_doc.py`:

```
if has_doctest and not is_empty_line(line):
   prefix = "... " if line.startswith(" ") or line in [")", "]", "}"] or in_triple_quotes else ">>> "
```

Since my line doesn't start - or is in - any of those options above, it just adds the `>>>`?

~I guess adding the option for the line to start with `@` would be a good solution then :)~ Ah no that don't do. It would need to check that the preceding line has the `@`.

Hey @stevhliu, I think something wrong happened with your rebase or merge, do you mind closing this PR and opening one again from the same branch?

There are 359 files changed in this one :)