layoutlm TokenClassificationPipeline
Hi, I was looking at using transformers.pipeline for TokenClassification with an instance of  microsoft/layoutlm-base-uncased that I have fine tuned.  I would like to use pipeline to take advantage of the entity aggregation_strategy feature for extracted entities.

However it is unclear to me how/whether TokenClassificationPipeline works with layoutlm for inference because layoutlm expects both a input text and input bounding boxes, unlike other text only models.  

Do you know if TokenClassificationPipeline is supposed to work with layoutlm and are there any examples?
cc @NielsRogge <|||||>I'm afraid the `TokenClassificationPipeline` will not work with LayoutLM, the reason being that, as you mention, the model expects an additional input besides text, namely bounding boxes.

We are currently discussing the design of pipelines for models like LayoutLM. 

<|||||>Ok thanks for the information!  I'll just work around it for now.<|||||>@NielsRogge are you aware of any developments in terms of pipeline integration for LayoutLM-like models? Thanks :) <|||||>@mishig25 worked on supporting LayoutLM for the object detection pipeline, but that wasn't added in the end. Not sure if we can add it to the existing pipeline, cause the model requires a few additional inputs (`bbox`, and `pixel_values`), cc @Narsil <|||||>Hi, it probably won't be implemented directly in `transformers` because arguments are different and so on.

However you should be able to override the pipeline yourself doing something like

```python

pipe = pipeline(model="..." , pipeline_class=MyPipeline)

class MyPipeline(Pipeline):
    def preprocess(self, inputs):
       # Just return the inputs that will be sent to the model
       return model_inputs
       
    def _forward(self, model_inputs):
        model_outputs = self.model(**model_inputs)
        return model_outputs
        
     def postprocess(self, model_outputs):
         # Finalize the objects
         return final_object
```

If you inherit `TokenClassificationPipeline you could definitely reuse stuff being done with aggregation_strategies
         