- An implementation for LREC-COLING 2024 paper Few-shot Named Entity Recognition via Superposition Concept Discrimination
conda create -n supercd python=3.9.0
conda activate supercd
bash env.sh
The pre-trained models are in huggingface: SIR and CE
You can run:
python main.py --output_dir output_dir \
--dataset ${dataset} \
--plm bert-base-uncased \
--plmpath bert-base-uncased \
--modelname tagmodel \
--per_device_train_batch_size 4 \
--do_train \
--shot 5 \
--maxshot 5 \
--save_strategy no \
--num_train_epochs 10 \
--learning_rate 1e-4 \
--warmup_ratio 0.1 \
--active supercd \
--save_total_limit 1
The result will be in output_dir. You can change the shot
for different shot and maxshot
is the additional shot for active learning.
For different pre-trained model, you should change plm
and plmpath
.
For different base model, you can change modelname
(tagmodel, structshot, proto, sdnet or container)
num_train_epochs
is set to 50 for sdnet and 10 for other models.
learning_rate
is set to 5e-5 for container and 1e-4 for other models.
The code is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License for Noncommercial use only. Any commercial use should get formal permission first.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.