padalavinaybhushan commited on
Commit
bffb91a
1 Parent(s): ca3ceeb
Files changed (1) hide show
  1. README.md +1 -56
README.md CHANGED
@@ -1,59 +1,4 @@
1
- ---
2
- language: en
3
- license: mit
4
- pipeline_tag: document-question-answering
5
- tags:
6
- - layoutlm
7
- - document-question-answering
8
- - pdf
9
- widget:
10
- - text: "What is the invoice number?"
11
- src: "https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png"
12
- - text: "What is the purchase amount?"
13
- src: "https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/contract.jpeg"
14
- ---
15
-
16
- # LayoutLM for Visual Question Answering
17
-
18
- This is a fine-tuned version of the multi-modal [LayoutLM](https://aka.ms/layoutlm) model for the task of question answering on documents. It has been fine-tuned using both the [SQuAD2.0](https://huggingface.co/datasets/squad_v2) and [DocVQA](https://www.docvqa.org/) datasets.
19
-
20
- ## Getting started with the model
21
-
22
- 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).
23
-
24
- ```python
25
- from transformers import pipeline
26
-
27
- nlp = pipeline(
28
- "document-question-answering",
29
- model="impira/layoutlm-document-qa",
30
- )
31
-
32
- nlp(
33
- "https://templates.invoicehome.com/invoice-template-us-neat-750px.png",
34
- "What is the invoice number?"
35
- )
36
- # {'score': 0.9943977, 'answer': 'us-001', 'start': 15, 'end': 15}
37
-
38
- nlp(
39
- "https://miro.medium.com/max/787/1*iECQRIiOGTmEFLdWkVIH2g.jpeg",
40
- "What is the purchase amount?"
41
- )
42
- # {'score': 0.9912159, 'answer': '$1,000,000,000', 'start': 97, 'end': 97}
43
-
44
- nlp(
45
- "https://www.accountingcoach.com/wp-content/uploads/2013/10/[email protected]",
46
- "What are the 2020 net sales?"
47
- )
48
- # {'score': 0.59147286, 'answer': '$ 3,750', 'start': 19, 'end': 20}
49
- ```
50
-
51
- **NOTE**: This model and pipeline was recently landed in transformers via [PR #18407](https://github.com/huggingface/transformers/pull/18407) and [PR #18414](https://github.com/huggingface/transformers/pull/18414), so you'll need to use a recent version of transformers, for example:
52
-
53
- ```bash
54
- pip install git+https://github.com/huggingface/transformers.git@2ef774211733f0acf8d3415f9284c49ef219e991
55
- ```
56
 
57
  ## About us
58
 
59
- This model was created by the team at [Impira](https://www.impira.com/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  ## About us
3
 
4
+ This model was created by the team at (DarwinBox|Vinay Bhushan|Rushikesh|Koushik).