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
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,16 +16,11 @@ This is a fine-tuned version of the multi-modal [LayoutLM](https://aka.ms/layout
|
|
| 16 |
To run these examples, you must have [PIL](https://pillow.readthedocs.io/en/stable/installation.html), [pytesseract](https://pypi.org/project/pytesseract/), and [PyTorch](https://pytorch.org/get-started/locally/) installed in addition to [transformers](https://huggingface.co/docs/transformers/index).
|
| 17 |
|
| 18 |
```python
|
| 19 |
-
from transformers import
|
| 20 |
-
|
| 21 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 22 |
-
"impira/layoutlm-document-qa",
|
| 23 |
-
add_prefix_space=True,
|
| 24 |
-
)
|
| 25 |
|
| 26 |
nlp = pipeline(
|
|
|
|
| 27 |
model="impira/layoutlm-document-qa",
|
| 28 |
-
tokenizer=tokenizer,
|
| 29 |
)
|
| 30 |
|
| 31 |
nlp(
|
|
|
|
| 16 |
To run these examples, you must have [PIL](https://pillow.readthedocs.io/en/stable/installation.html), [pytesseract](https://pypi.org/project/pytesseract/), and [PyTorch](https://pytorch.org/get-started/locally/) installed in addition to [transformers](https://huggingface.co/docs/transformers/index).
|
| 17 |
|
| 18 |
```python
|
| 19 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
nlp = pipeline(
|
| 22 |
+
"document-question-answering",
|
| 23 |
model="impira/layoutlm-document-qa",
|
|
|
|
| 24 |
)
|
| 25 |
|
| 26 |
nlp(
|