Buckets:
1.54 GB
13 files
Updated 3 days ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| .gitattributes | 1.4 kB xet | 05396568 | |
| README.md | 2.33 kB xet | 706cd389 | |
| config.json | 789 Bytes xet | 296cf20a | |
| merges.txt | 456 kB xet | c085dbf3 | |
| model.safetensors | 511 MB xet | ede7d942 | |
| pyproject.toml | 57 Bytes xet | 7813b0f9 | |
| pytorch_model.bin | 511 MB xet | 28a017d3 | |
| setup.cfg | 388 Bytes xet | ffccf9e3 | |
| special_tokens_map.json | 239 Bytes xet | 36c93964 | |
| tf_model.h5 | 511 MB xet | 192fa2ce | |
| tokenizer.json | 1.36 MB xet | 1e17f03f | |
| tokenizer_config.json | 315 Bytes xet | 7b6c7201 | |
| vocab.json | 798 kB xet | 0fdf3fe7 |
LayoutLM for Visual Question Answering
This is a fine-tuned version of the multi-modal LayoutLM model for the task of question answering on documents. It has been fine-tuned using both the SQuAD2.0 and DocVQA datasets.
Getting started with the model
To run these examples, you must have PIL, pytesseract, and PyTorch installed in addition to transformers.
from transformers import pipeline
nlp = pipeline(
"document-question-answering",
model="impira/layoutlm-document-qa",
)
nlp(
"https://templates.invoicehome.com/invoice-template-us-neat-750px.png",
"What is the invoice number?"
)
# {'score': 0.9943977, 'answer': 'us-001', 'start': 15, 'end': 15}
nlp(
"https://miro.medium.com/max/787/1*iECQRIiOGTmEFLdWkVIH2g.jpeg",
"What is the purchase amount?"
)
# {'score': 0.9912159, 'answer': '$1,000,000,000', 'start': 97, 'end': 97}
nlp(
"https://www.accountingcoach.com/wp-content/uploads/2013/10/income-statement-example@2x.png",
"What are the 2020 net sales?"
)
# {'score': 0.59147286, 'answer': '$ 3,750', 'start': 19, 'end': 20}
NOTE: This model and pipeline was recently landed in transformers via PR #18407 and PR #18414, so you'll need to use a recent version of transformers, for example:
pip install git+https://github.com/huggingface/transformers.git@2ef774211733f0acf8d3415f9284c49ef219e991
About us
This model was created by the team at Impira.
- Total size
- 1.54 GB
- Files
- 13
- Last updated
- Nov 24
- Pre-warmed CDN
- US EU US EU