RpBERT

March 31, 2023 ยท View on GitHub

This is a implementation of the paper RpBERT: A Text-image Relation Propagation-based BERT Model for Multimodal NER.

Requirements

Datasets

Run loader.py to make sure the statistics is identical as (Zhang et al., 2018) and (Lu et al., 2018).

Twitter-15NUMPERLOCORGMISC
Training400022172091928940
Development1000552522247225
Testing325718161697839726
Twitter-17NUMTOKEN
Training429068655
Development143222872
Testing145923051

Models

Libraries

  • tqdm
  • Pillow
  • numpy
  • torch
  • torchvision
  • transformers
  • flair
  • pytorch-crf

Usage

# BERT-BiLSTM-CRF
python main.py --stacked --rnn --crf --dataset [dataset_id] --cuda [gpu_id]
# RpBERT-BiLSTM-CRF
python main.py --stacked --rnn --crf --encoder_v resnet101 --aux --gate --dataset [dataset_id] --cuda [gpu_id]