Defining top_k within pipeline changes output from list to nested list
Author: Harjas123
Pull request: no

### System Info

```
- `transformers` version: 4.30.2
- Platform: Linux-5.14.0-162.22.2.el9_1.x86_64-x86_64-with-glibc2.34
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- Safetensors version: 0.3.1
- PyTorch version (GPU?): 1.11.0+cu102 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no
```

### Who can help?

@Narsil
@sgugger

### Reproduction

Was trying to output all scores for a single-label classification problem. Initially tried to use `return_all_scores` as written in the docs for TextClassificationPipeline, which returned this error:
```UserWarning: return_all_scores is now deprecated,  if want a similar funcionality use top_k=None instead of return_all_scores=True or top_k=1 instead of return_all_scores=False.```

Switched to top_k, but some of my code broke in strange ways. Eventually realized that it was because calling pipeline without top_k returns a list containing a dictionary, but calling it with top_k returns a list containing a list containing a dictionary, regardless of what value top_k is set to.

Without top_k=1:
`from transformers import pipeline`
`classifier = pipeline("sentiment-analysis", model="ProsusAI/finbert")`
`classifier("Inflation Remains Risk Confronting Financial Markets")`
Resulting output:
`[{'label': 'negative', 'score': 0.8932788372039795}]`

With top_k=1:
`from transformers import pipeline`
`classifier = pipeline("sentiment-analysis", model="ProsusAI/finbert", top_k=1)`
`classifier("Inflation Remains Risk Confronting Financial Markets")`
Resulting output:
`[[{'label': 'negative', 'score': 0.8932788372039795}]]`

With top_k=None:
`from transformers import pipeline`
`classifier = pipeline("sentiment-analysis", model="ProsusAI/finbert", top_k=None)`
`classifier("Inflation Remains Risk Confronting Financial Markets")`
Resulting output:
`[[{'label': 'negative', 'score': 0.8932788372039795},`
`{'label': 'neutral', 'score': 0.07486031949520111},`
 `{'label': 'positive', 'score': 0.03186087682843208}]]`

This issue does not occur if top_k is set within `__call__`:
`from transformers import pipeline`
`classifier = pipeline("sentiment-analysis", model="ProsusAI/finbert")`
`classifier("Inflation Remains Risk Confronting Financial Markets", top_k=None)`
Resulting output:
`[{'label': 'negative', 'score': 0.8932788372039795},`
`{'label': 'neutral', 'score': 0.07486031949520111},`
 `{'label': 'positive', 'score': 0.03186087682843208}]`

### Expected behavior

Behavior should be consistent regardless of whether top_k has been set within pipeline, set within `__call__`, or not set at all.

Also, [the documentation for TextClassificationPipeline](https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.TextClassificationPipeline) says that top_k is a parameter under `__call__`, but does not explain that top_k is also a parameter under pipeline.

Comments:
Hi @Harjas123 thank you for reporting! Our team will take a look.

also cc @Narsil 

I agree that this is inconsistent but I don't think there is much to do about it now since this has been the case for the past three years, and making any change would break a lot of users code.

I understand. Would it at least be possible to add a mention of this somewhere in the docs?

Harmonizing outputs of pipelines is definitely in my mind for V5 if/when it happens :)

@Narsil Still some issues on v5.

@ArthurZucker .