|
3 | 3 | from unitxt.collections_operators import Explode, Wrap
|
4 | 4 | from unitxt.image_operators import ToImage
|
5 | 5 | from unitxt.operators import Copy
|
| 6 | +from unitxt.splitters import RenameSplits |
6 | 7 | from unitxt.templates import MultiReferenceTemplate
|
7 | 8 | from unitxt.test_utils.card import test_card
|
8 | 9 |
|
|
47 | 48 |
|
48 | 49 | test_card(card)
|
49 | 50 | add_to_catalog(card, f"cards.doc_vqa.{language}", overwrite=True)
|
| 51 | + |
| 52 | + |
| 53 | +card = TaskCard( |
| 54 | + loader=LoadHF( |
| 55 | + path="lmms-lab/DocVQA", |
| 56 | + name="DocVQA", |
| 57 | + data_classification_policy=["public"], |
| 58 | + splits=["test", "validation"], |
| 59 | + ), |
| 60 | + preprocess_steps=[ |
| 61 | + RenameSplits(mapper={"validation": "test"}), |
| 62 | + ToImage(field="image", to_field="context"), |
| 63 | + Set(fields={"context_type": "image"}), |
| 64 | + ], |
| 65 | + task="tasks.qa.with_context.abstractive[metrics=[metrics.anls]]", |
| 66 | + templates=[template, *templates.items], |
| 67 | + default_template=template, |
| 68 | + __tags__={ |
| 69 | + "license": "apache-2.0", |
| 70 | + "multilinguality": "monolingual", |
| 71 | + "modalities": ["image", "text"], |
| 72 | + "size_categories": "10K<n<100K", |
| 73 | + "task_categories": "question-answering", |
| 74 | + "task_ids": "extractive-qa", |
| 75 | + }, |
| 76 | + __description__=( |
| 77 | + "The doc-vqa Dataset integrates images from the Infographic_vqa dataset sourced from HuggingFaceM4 The Cauldron dataset, as well as images from the dataset AFTDB (Arxiv Figure Table Database) curated by cmarkea. This dataset consists of pairs of images and corresponding text, with each image linked to an average of five questions and answers available in both English and French. These questions and answers were generated using Gemini 1.5 Pro, thereby rendering the dataset well-suited for multimodal tasks involving image-text pairing and multilingual question answering." |
| 78 | + ), |
| 79 | +) |
| 80 | + |
| 81 | +test_card(card) |
| 82 | +add_to_catalog(card, "cards.doc_vqa.lmms_eval", overwrite=True) |
0 commit comments