|
--- |
|
license: apache-2.0 |
|
task_categories: |
|
- question-answering |
|
language: |
|
- en |
|
size_categories: |
|
- n<1K |
|
configs: |
|
- config_name: benchmark |
|
data_files: |
|
- split: test |
|
path: dataset.json |
|
paperswithcode_id: mapeval-visual |
|
--- |
|
|
|
# MapEval-Visual |
|
|
|
This dataset was introduced in [MapEval](https://arxiv.org/abs/2501.00316) |
|
|
|
## Prerequisite |
|
|
|
Download the [Vdata.zip](https://huggingface.co/datasets/MapEval/MapEval-Visual/resolve/main/Vdata.zip?download=true) and extract in the working directory. |
|
|
|
## Usage |
|
```python |
|
from datasets import load_dataset |
|
import PIL.Image |
|
# Load dataset |
|
ds = load_dataset("MapEval/MapEval-Visual", name="benchmark") |
|
|
|
for item in ds["test"]: |
|
|
|
# Start with a clear task description |
|
prompt = ( |
|
"You are a highly intelligent assistant. " |
|
"Based on the given image, answer the multiple-choice question by selecting the correct option.\n\n" |
|
"Question:\n" + item["question"] + "\n\n" |
|
"Options:\n" |
|
) |
|
|
|
# List the options more clearly |
|
for i, option in enumerate(item["options"], start=1): |
|
prompt += f"{i}. {option}\n" |
|
|
|
# Add a concluding sentence to encourage selection of the answer |
|
prompt += "\nSelect the best option by choosing its number." |
|
|
|
# Pass the image to the model along with the prompt |
|
img = PIL.Image.open(item["context"]) |
|
|
|
# Use the prompt as needed |
|
print([prompt, img]) # Replace with your processing logic |
|
``` |
|
|
|
|