Datasets:
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 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. 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. Each part of the dataset is stored as JSON Lines 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:
- Get Flickr30k data by filling out the form here and unzip it into a folder (e.g. flickr30k).
- Download scripts/build_fm30k_full.py and create a file named config.ini on the same folder as the script.
- The cotents of the .ini should be similar to this (change the folder names if you want):
[FM30K]
dataset_folder=FM30K
[flickr30k]
image_folder=flickr30k
[huggingface]
api_token = <YOUR-HUGGINGFACE-API-KEY>
download_folder = hf_downloads
- (optional) Install depedencies to run the script to build the final dataset:
pip install requests pandas transformers
- 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
python build_fm30k_full.py
- To use the final version, just use datasets:
from datasets import load_dataset
ds = load_dataset("FM30K")
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:
{
"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]) 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. 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 license. Requests for commercial use should be directed to [email protected].
- Downloads last month
- 58