This repository contains the code and benchmarks for the paper Guiding Large Language Models for Biomedical Entity Linking via Restrictive and Contrastive Decoding.
For example, to reproduce Mistral-7b-v0.3 with LLM4BioEL on NCBI, here is the bash script with
CUDA_VISIBLE_DEVICES=0 python3 run_bioEL.py \
--model mistral-7b \
--dataset dataproc/ncbi_test_with_20_labels_and_10_prompts_with_score.json \
--output output/ncbi_test_mistral_7b_label3_shot5_seed10.json \
--n_labels 3 \
--n_shots 5 \
--random_seed 10 \
--use_dynamics 2To reproduce Llama-3-8b (ICL with 10-shot prompts) on BC5CDR, here is the bash script.
CUDA_VISIBLE_DEVICES=0 python3 run_bioEL_fewshots.py \
--model llama3-8b \
--infile dataproc/ncbi_test_with_20_random_prompts.json \
--outfile output/ncbi_baseline_llama3_8b_10shot.jsonTo reproduce Llama-3-8b (greedy decoding) on COMETA, here is the bash script.
CUDA_VISIBLE_DEVICES=5 python3 run_bioEL_baseline.py \
--model llama3-8b \
--infile dataproc/ncbi_test_with_20_labels_and_100_prompts.json \
--outfile output/ncbi_baseline_llama3_8b.json