|
--- |
|
license: cc-by-nc-4.0 |
|
language: |
|
- pt |
|
- en |
|
tags: |
|
- Multimodality |
|
- Image-Description Pairs |
|
- Semantic Frames |
|
- FrameNet |
|
- Image |
|
- Text |
|
pretty_name: Framed Multi30k |
|
task_categories: |
|
- translation |
|
configs: |
|
- config_name: visual (annotated without captions) |
|
data_files: |
|
- split: train |
|
path: "data/framed30k/IMG_VNC/train.jsonl" |
|
- split: test |
|
path: "data/framed30k/IMG_VNC/test.jsonl" |
|
- split: val |
|
path: "data/framed30k/IMG_VNC/val.jsonl" |
|
- config_name: visual (annotated with captions) |
|
data_files: |
|
- split: train |
|
path: "data/framed30k/IMG_VWC/train.jsonl" |
|
- split: test |
|
path: "data/framed30k/IMG_VWC/test.jsonl" |
|
- split: val |
|
path: "data/framed30k/IMG_VWC/val.jsonl" |
|
- config_name: portuguese (new) |
|
data_files: |
|
- split: train |
|
path: "data/framed30k/PTO/train.jsonl" |
|
- split: test |
|
path: "data/framed30k/PTO/test.jsonl" |
|
- split: val |
|
path: "data/framed30k/PTO/val.jsonl" |
|
- config_name: portuguese (translations) |
|
data_files: |
|
- split: train |
|
path: "data/framed30k/PTT/train.jsonl" |
|
- split: test |
|
path: "data/framed30k/PTT/test.jsonl" |
|
- split: val |
|
path: "data/framed30k/PTT/val.jsonl" |
|
- config_name: english (original) |
|
data_files: |
|
- split: train |
|
path: "data/framed30k/ENO/train.jsonl" |
|
- split: test |
|
path: "data/framed30k/ENO/test.jsonl" |
|
- split: val |
|
path: "data/framed30k/ENO/val.jsonl" |
|
--- |
|
# Framed Multi30k (FM30K) |
|
|
|
This repo contains the scripts and data related to the Framed Multi30k (FM30K) dataset. |
|
|
|
The dataset can be found in three different formats: |
|
- Under [data/flickr30k](data/flickr30k) the new, original 158,915 descriptions for Flickr30k images in Brazilian Portuguese can be found in the same format used by Flickr30k to provide captions. |
|
- The 31,014 translations of English captions from Flickr30k, align with translations from Multi30k can be found in [data/multi30k](data/multi30k). These sentences are already split into train, test and val sets aligned with Multi30k. The tokenized versions are also provided. |
|
- Finally, for the frame annotated sentences and images, use the files in [data/framed30k](data/framed30k). Each part of the dataset is stored as [JSON Lines](https://jsonlines.org/) files and its splits are stored in subfolders with the same names. |
|
|
|
## How to use |
|
|
|
FM30K is better used when its data is aligned with data from the original Flick30k and from Flickr30K Entities datasets. To use the full dataset with HuggingFace's datasets library, the following steps must be taken: |
|
|
|
1. Get Flickr30k data by filling out the form [here](https://shannon.cs.illinois.edu/DenotationGraph/) and unzip it into a folder (e.g. **flickr30k**). |
|
2. Download [scripts/build_fm30k_full.py](scripts/build_fm30k_full.py) and create a file named **config.ini** on the same folder as the script. |
|
3. The cotents of the **.ini** should be similar to this (change the folder names if you want): |
|
```dosini |
|
[FM30K] |
|
dataset_folder=FM30K |
|
|
|
[flickr30k] |
|
image_folder=flickr30k |
|
|
|
[huggingface] |
|
api_token = <YOUR-HUGGINGFACE-API-KEY> |
|
download_folder = hf_downloads |
|
``` |
|
4. **(optional)** Install depedencies to run the script to build the final dataset: |
|
```sh |
|
pip install requests pandas transformers |
|
``` |
|
5. Run the script. It will download Flickr30K Entities, merge its bounding box information with FM30K and build a final dataset with images and all annotation from this dataset |
|
```sh |
|
python build_fm30k_full.py |
|
``` |
|
6. To use the final version, just use **datasets**: |
|
```python |
|
from datasets import load_dataset |
|
|
|
ds = load_dataset("FM30K") |
|
``` |
|
```sh |
|
DatasetDict({ |
|
train: Dataset({ |
|
features: ['image', 'IMG_VNC', 'IMG_VWC', 'PTO', 'ENO', 'PTT'], |
|
num_rows: 23837 |
|
}) |
|
validation: Dataset({ |
|
features: ['image', 'IMG_VNC', 'IMG_VWC', 'PTO', 'ENO', 'PTT'], |
|
num_rows: 3973 |
|
}) |
|
test: Dataset({ |
|
features: ['image', 'IMG_VNC', 'IMG_VWC', 'PTO', 'ENO', 'PTT'], |
|
num_rows: 3973 |
|
}) |
|
}) |
|
``` |
|
The features are lists containing records from each subset realted to the image. |
|
|
|
|
|
## JSONL files |
|
|
|
An example of how a line the JSON Lines looks like is: |
|
|
|
```json |
|
{ |
|
"sentenceId": 29643249, |
|
"flickr30kImageId": "1053116826.jpg", |
|
"flickr30kSentenceNumber": 5, |
|
"sentence": "Duas crianças estão rindo na grama.", |
|
"tokens": [ "Duas", "crianças", "estão", "rindo", "na", "grama", "." ], |
|
"frames": [ |
|
{ |
|
"id": "Cardinal_numbers", |
|
"span": [0, 0], |
|
"frameElements": [{ "id": "Entity", "span": [1, 1] }] |
|
}, |
|
{ "id": "People_by_age", "span": [1, 1], "frameElements": [] }, |
|
... |
|
] |
|
} |
|
``` |
|
|
|
All files contain a reference to the original Flickr30k dataset either through ```flickr30kImageId``` (image) or the pair ```(flickr30kImageId, flickr30kSentenceNumber)``` (sentence). For example, to use only the "reference" sentences of the ENO subset, one needs to filter out all rows in which (flickr30kImageId, flickr30kSentenceNumber) is not also found in PTT or IMG_VNC, i.e., there's no translation for that sentence or no visual annotation on the bounding boxes based on that English sentence. The ```span``` property of frames and frameElements represent the interval of tokens where that entity is realized in the sentence. |
|
|
|
The Portuguese Original Captions (e.g. [eval.jsonl](data/framed30k/PTO/eval.jsonl)]) don't have ```flickr30kSentenceNumber``` set, only ```sentenceNumber``` to identify that sentence number for the image. |
|
|
|
For IMG files (either IMG_VWC for those annotated with the presence of captions or IMG_VNC for those without), two extra fields (```annotationCondition``` and ```flickr30kEntitiesObjectId```) are set. The first is used to tell the annotation condition (one for each file). The second links the annotation to a Flickr30k Entities object. |
|
|
|
|
|
## How to cite |
|
|
|
Marcelo Viridiano, Arthur Lorenzi, Tiago Timponi Torrent, Ely E. Matos, Adriana S. Pagano, Natália Sathler Sigiliano, Maucha Gamonal, Helen de Andrade Abreu, Lívia Vicente Dutra, Mairon Samagaio, Mariane Carvalho, Franciany Campos, Gabrielly Azalim, Bruna Mazzei, Mateus Fonseca de Oliveira, Ana Carolina Luz, Livia Padua Ruiz, Júlia Bellei, Amanda Pestana, et al.. 2024. [Framed Multi30K: A Frame-Based Multimodal-Multilingual Dataset](https://aclanthology.org/2024.lrec-main.656/). In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), pages 7438–7449, Torino, Italia. ELRA and ICCL. |
|
|
|
## License |
|
|
|
This dataset is shared under a [CC BY-NC 4.0 DEED](https://creativecommons.org/licenses/by-nc/4.0/deed.en) license. Requests for commercial use should be directed to [[email protected]](mailto:[email protected]). |
|
|