TokenClassificationPipeline `TypeError: postprocess() got an unexpected keyword argument 'ignore_labels'`
Author: GuillemGSubies
Pull request: no

## Environment info

- `transformers` version: 4.12.2
- Platform: Linux-4.4.0-210-generic-x86_64-with-glibc2.23
- Python version: 3.9.7
- PyTorch version (GPU?): 1.10.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

Library:

- Pipelines: @Narsil

## Information

So when using the NER pipeline I get an error with `ignore_labels`. Below you can see how that parameter ends up in `postprocess_params`.

https://github.com/huggingface/transformers/blob/68427c9bebd1e4ff43d25b18bb9c7eb786303712/src/transformers/pipelines/token_classification.py#L149

However, `self.postprocess` doesn't allow that parameter so the error raises.

https://github.com/huggingface/transformers/blob/68427c9bebd1e4ff43d25b18bb9c7eb786303712/src/transformers/pipelines/token_classification.py#L219

I tried all this in the latest version of transformers, but for what I see, the master branch still has the bug. The solution to this would be to delete `ignore_labels` from `postprocess_params` given that `self.postprocess` uses `self.ignore_labels`. However, if we want to be able to change this behavior so we can change `ignore_labels` when calling `__call__` further changes should be introduced.

Please tell me what fix would you prefer and I will send a PR.

The problem arises when using:
* [X] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [X] an official GLUE/SQUaD task: (give the name) NER
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

Just run

```python
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
  
tokenizer = AutoTokenizer.from_pretrained("dslim/bert-base-NER")

model = AutoModelForTokenClassification.from_pretrained("dslim/bert-base-NER")

pipe = pipeline(
    task="ner",
    model=model,
    tokenizer=tokenizer,
    framework="pt",
    ignore_labels= [],
)
pipe("Some example text")
```

## Expected behavior

I expect it to work correctly, but the following error raises:

```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_4280/2760559991.py in <module>
     12     ignore_labels= [],
     13 )
---> 14 pipe("Some example text")

~/.conda/envs/prueba_token1/lib/python3.9/site-packages/transformers/pipelines/token_classification.py in __call__(self, inputs, **kwargs)
    179         self.offset_mappings = offset_mappings
    180 
--> 181         return super().__call__(inputs, **kwargs)
    182 
    183     def preprocess(self, sentence):

~/.conda/envs/prueba_token1/lib/python3.9/site-packages/transformers/pipelines/base.py in __call__(self, inputs, num_workers, *args, **kwargs)
    922             return self.get_iterator(inputs, num_workers, preprocess_params, forward_params, postprocess_params)
    923         else:
--> 924             return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
    925 
    926     def run_multi(self, inputs, preprocess_params, forward_params, postprocess_params):

~/.conda/envs/prueba_token1/lib/python3.9/site-packages/transformers/pipelines/base.py in run_single(self, inputs, preprocess_params, forward_params, postprocess_params)
    930         model_inputs = self.preprocess(inputs, **preprocess_params)
    931         model_outputs = self.forward(model_inputs, **forward_params)
--> 932         outputs = self.postprocess(model_outputs, **postprocess_params)
    933         return outputs

TypeError: postprocess() got an unexpected keyword argument 'ignore_labels'
```


Comments:
@GuillemGSubies You are entirely correct, this is an error.

See attached PR for the fix.

Wow that was fast! It looks great, thank you so much

@LysandreJik I am still getting this error with transformers version 4.12.5
Is the fix not released yet?

No indeed it was not included, will be in the next release (v4.13) which should land in a few days at most.