Correct & Improve Doctests for LayoutLMv2
# What does this PR do?

Ready for Review now. 

Issue #16292

Add correct doctests for LayoutLMv2

Note: LayoutLMv2 depends on `detectron2`, `torchvision` and `tesseract`; passing doctests requires their installation. I documented this in the docstring. 


## Who can review?

@patrickvonplaten  @ydshieh  @sgugger 
_The documentation is not available anymore as the PR was closed or merged._<|||||>@sgugger @ydshieh Sorry for the late response and thank you for reviewing! Just made the changes addressing all the comments here.<|||||>Thanks for this PR - although the update in the docs doesn't seem correct to me.<|||||>@NielsRogge just started a follow-up PR #17409. Let me know if there's anything else I can do.