Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM4BioEL

This repository contains the code and benchmarks for the paper Guiding Large Language Models for Biomedical Entity Linking via Restrictive and Contrastive Decoding.

Experiments

For example, to reproduce Mistral-7b-v0.3 with LLM4BioEL on NCBI, here is the bash script with $k=3$ and $n=5$.

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 2

To 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.json

To 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

About

The code for paper "LLM4BioEL"

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages