A few-shot learning method based on siamese networks.
Code & models for the paper to appear at ACL 2022.
symanto-fsb
implements the benchmark discussed in the paper.
It can be easily extended to evaluate new models. See the extension section below.
pip install -e .
symanto-fsb evaluate-char-svm output/char_svm --n-trials=1
This will run the specified number of trials on each dataset and write results to the output directory. Afterwards you can create a result table:
symanto-fsb report output /tmp/report.tsv
symanto-fsb \
evaluate-sentence-transformer \
output/pml-mpnet \
--gpu 0 \
--n-examples=0 \
--n-trials=1
symanto-fsb \
evaluate-sentence-transformer \
output/pml-mpnet \
--gpu 0 \
--n-examples=8 \
--n-trials=1
In general a new model is added by adding:
Datasets hosted on Google Drive do not work right now: datasets issue/3809
pip install -r dev-requirements.txt
dev-tools/format.sh
dev-tools/lint.sh
dev-tools/test.sh
For the sake of comparability we trained 4. The code above can be used with the Siamese network models.
- mpnet-base-snli-mnli (English)
- xlm-roberta-base-snli-mnli-anli-xnli (ML)
- sn-mpnet-base-snli-mnli (English)
- sn-xlm-roberta-base-snli-mnli-anli-xnli (ML)
This is not an official Symanto product!
@inproceedings{labeltuning2022,
title = {{Few-Shot} {Learning} with {Siamese} {Networks} and {Label} {Tuning}},
author = {M{\"u}ller, Thomas and Pérez-Torró, Guillermo and Franco-Salvador, Marc},
year = {2022},
booktitle = {ACL (to appear)},
url = {https://arxiv.org/abs/2203.14655},
}