rubentito commited on
Commit
0e64c53
·
1 Parent(s): 899da1a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -1
README.md CHANGED
@@ -1,3 +1,71 @@
1
  ---
2
- license: gpl
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: gpl-3.0
3
+ tags:
4
+ - DocVQA
5
+ - Document Question Answering
6
+ - Document Visual Question Answering
7
+ datasets:
8
+ - rubentito/mp-docvqa
9
+ language:
10
+ - en
11
  ---
12
+
13
+ # LongT5 base with transient-global attention fine-tuned on MP-DocVQA
14
+
15
+ This is LongT5 trained on SQuADv2, CoQA and TryoCoQA datasets from [Tryolabs hub](https://huggingface.co/tryolabs/long-t5-tglobal-base-blogpost-cqa-onnx) and fine-tuned on Multipage DocVQA (MP-DocVQA) dataset.
16
+
17
+
18
+ ## How to use
19
+
20
+ Here is how to use this model to get the features of a given text in PyTorch:
21
+
22
+ ```python
23
+ import torch
24
+ from transformers import AutoTokenizer, LongT5ForConditionalGeneration
25
+
26
+ tokenizer = AutoTokenizer.from_pretrained("rubentito/longt5-tglobal-base-mpdocvqa")
27
+ model = LongT5ForConditionalGeneration.from_pretrained("rubentito/longt5-tglobal-base-mpdocvqa")
28
+
29
+ context = "Huggingface has democratized NLP. Huge thanks to Huggingface for this."
30
+ question = "What has Huggingface done?"
31
+ input_text = "question: {:s} context: {:s}".format(question, context)
32
+
33
+ encoding = tokenizer(input_text, return_tensors="pt")
34
+ output = self.model.generate(**encoding)
35
+ answer = tokenizer.decode(output['sequences'], skip_special_tokens=True)
36
+ ```
37
+
38
+ ## Metrics
39
+ **Average Normalized Levenshtein Similarity (ANLS)**
40
+
41
+ The standard metric for text-based VQA tasks (ST-VQA and DocVQA). It evaluates the method's reasoning capabilities while smoothly penalizes OCR recognition errors.
42
+ Check [Scene Text Visual Question Answering](https://arxiv.org/abs/1905.13648) for detailed information.
43
+
44
+ **Answer Page Prediction Accuracy (APPA)**
45
+
46
+ In the MP-DocVQA task, the models can provide the index of the page where the information required to answer the question is located. For this subtask accuracy is used to evaluate the predictions: i.e. if the predicted page is correct or not.
47
+ Check [Hierarchical multimodal transformers for Multi-Page DocVQA](https://arxiv.org/abs/2212.05935) for detailed information.
48
+
49
+ ## Model results
50
+
51
+ Extended experimentation can be found in Table 2 of [Hierarchical multimodal transformers for Multi-Page DocVQA](https://arxiv.org/pdf/2212.05935.pdf).
52
+ You can also check the live leaderboard at the [RRC Portal](https://rrc.cvc.uab.es/?ch=17&com=evaluation&task=4).
53
+ | Model | HF name | Parameters | ANLS | APPA |
54
+ |-----------------------------------------------------------------------------------|:--------------------------------------|:-------------:|:-------------:|:---------:|
55
+ | [Bert large](https://huggingface.co/rubentito/bert-large-mpdocvqa) | rubentito/bert-large-mpdocvqa | 334M | 0.4183 | 51.6177 |
56
+ | [Longformer base](https://huggingface.co/rubentito/longformer-base-mpdocvqa) | rubentito/longformer-base-mpdocvqa | 148M | 0.5287 | 71.1696 |
57
+ | [BigBird ITC base](https://huggingface.co/rubentito/bigbird-base-itc-mpdocvqa) | rubentito/bigbird-base-itc-mpdocvqa | 131M | 0.4929 | 67.5433 |
58
+ | [LayoutLMv3 base](https://huggingface.co/rubentito/layoutlmv3-base-mpdocvqa) | rubentito/layoutlmv3-base-mpdocvqa | 125M | 0.4538 | 51.9426 |
59
+ | [**T5 base**](https://huggingface.co/rubentito/t5-base-mpdocvqa) | rubentito/t5-base-mpdocvqa | 223M | 0.5050 | 0.0000 |
60
+ | Hi-VT5 | TBA | 316M | 0.6201 | 79.23 |
61
+
62
+ ## Citation Information
63
+
64
+ ```tex
65
+ @article{tito2022hierarchical,
66
+ title={Hierarchical multimodal transformers for Multi-Page DocVQA},
67
+ author={Tito, Rub{\`e}n and Karatzas, Dimosthenis and Valveny, Ernest},
68
+ journal={arXiv preprint arXiv:2212.05935},
69
+ year={2022}
70
+ }
71
+ ```