This repository contains the PyTorch implementation and the data of the paper: CLIPMulti. AAA, BBB, CCC, DDD, EEE. Computer Speech & Language.[paper].
- Submit paper
- Prepare code and push
This codebase was developed and tested with the following settings:
scikit-learn==1.2.1
numpy==1.24.2
pytorch==2.0.1
torchvision==0.15.2
tqdm==4.64.1
clip==1.0
transformers==4.27.1
regex==2022.10.31
ftfy==6.1.1
pillow==9.4.0
CLIP:
pip install git+https://github.com/openai/CLIP.git
CLIPMulti
run main.py:
python main.py --dataset [dataset] --combination [combination] --prompt [prompt] --num_of_word [number_of word] --topk [number_of_topk] --test
[dataset]
in ['topic', 'emotion', 'situation', 'agnews', 'snips', 'trec', 'subj']
[combination]
in ['NSC', 'NWSC', 'MF']
dataset [subj]
only use ['MF']
[prompt]
in [0, 1, 2, 3]
prompt_0 is text written by humans based on labels
other is Match-CLIPMulti generation
[number_of word]
in [30, 40, 50]
prompt_1 have [30, 40, 50]
, prompt_2 and prompt_3 only have [30]
[number_of_topk]
in [1, 2, 3]
Match-CLIPMulti
run label2text_main.py:
python label2text_main.py --prompt [prompt] --num_of_word [number_of word] --topk [number_of_topk]
[prompt]
in [1, 2, 3]
[number_of word]
in [30, 40, 50]
prompt_1 have [30, 40, 50]
, prompt_2 and prompt_3 only have [30]
[number_of_topk]
in [1, 2, 3]