Source code and data for A Template Is All You Meme.
Contact person: Luke Bates
https://www.ukp.tu-darmstadt.de/
Don't hesitate to send us an e-mail or report an issue, if something is broken (and it shouldn't be) or if you have further questions.
This repository contains experimental software and is published for the sole purpose of giving additional background details on the respective publication.
tlc.py
-- Template-Label Countermain.py
-- code file that uses the other code filesmemetils.py
-- util codescriptorinos/
-- eda and scraping scripts
Install clip first.
Then, please use the requirements.txt
file.
Our data files are some chonky bois
For the moment, please contact us about accessing the KYMKB. :)
Remember, sometimes memes are mean. We take no responsiblility if they are offensive nor do they reflect our views in any way.
To setup, please follow the instructions below.
git clone https://github.com/UKPLab/a-template-is-all-you-meme.git
cd a-template-is-all-you-meme
python -m venv mvenv
source mvenv/bin/activate
pip install --upgrade pip
#install clip here please
pip install -r requirements.txt
You can run TLC with python main.py
. You can specifiy which configurations by passing arguments to python.
--template_path #directory where the KYMKB is located
--dataset #which dataset from the paper you want to play with
--data_root #where the datafiles are. only relevant for figmemes, mami, and multioff, which you should pass something like data/annotations, data/MAMI_DATASET, and data/MultiOFF_DATASET respectively
--num_neigh #how many neighbors are we talking about
--vote_type #template vs label vote
--split #only relevant for figmemes, mami, and multioff, which you should pass something like standard, task5_style, and standard respectively
--include_examples #template or templates+examples? True or False, respectively
--feature_extraction #which encoder? ViT-L/14@336px, ViT-B/32, or ViT-B/16
--task #only relevant for Memotion 3 1 = A, 2 = B
--combine #how to model the modalities, None (just template vs memes), concatenate, fusion, latefusion, or fancy (normalize then average)
--just_text #use just about vs OCR? True or False
--need_to_read #use our embeddings or note? True or False
Once finished, results will be printed out.
If our work was helpful for your work, please be so kind as to cite us:
@article{atiaym_2023,
url = {https://arxiv.org/abs/2311.06649},
author = {Luke Bates and Peter Ebert Christensen and Preslav Nakov and Iryna Gurevych},
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
journal={arXiv preprint arXiv:2311.06649},
title = {A Template Is All You Meme},
publisher = {arXiv},
year = {2023},
}
we would like thank Harambe. RIP to that king