parent
52e01b37cc
commit
ff904dfdbb
|
@ -16,16 +16,11 @@ This is a fine-tuned version of the multi-modal [LayoutLM](https://aka.ms/layout
|
||||||
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).
|
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).
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from transformers import AutoTokenizer, pipeline
|
from transformers import pipeline
|
||||||
|
|
||||||
tokenizer = AutoTokenizer.from_pretrained(
|
|
||||||
"impira/layoutlm-document-qa",
|
|
||||||
add_prefix_space=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
nlp = pipeline(
|
nlp = pipeline(
|
||||||
|
"document-question-answering",
|
||||||
model="impira/layoutlm-document-qa",
|
model="impira/layoutlm-document-qa",
|
||||||
tokenizer=tokenizer,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
nlp(
|
nlp(
|
||||||
|
|
Loading…
Reference in New Issue