Instructions to use impira/layoutlm-document-qa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use impira/layoutlm-document-qa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("document-question-answering", model="impira/layoutlm-document-qa")# Load model directly from transformers import AutoTokenizer, AutoModelForDocumentQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("impira/layoutlm-document-qa") model = AutoModelForDocumentQuestionAnswering.from_pretrained("impira/layoutlm-document-qa") - Notebooks
- Google Colab
- Kaggle
How I can specify specific segmentation mode for tesseract that Layoutlm should use?
#19
by anemilentsau - opened
Hi,
I am having an issue that default segmentation model for tesseract fails to extract properly the text from my document that leads to Layoutlm being incapable to provide correct answers. The proper segmentation mode shall be --psm 6. Is there a way to specify the tesseract segmentation mode that nlp pipeline for the question answering should use?