shengz's picture
Add the example usage.
e3ef0b9
|
raw
history blame
1.34 kB
# Knowledge-Rich Self-Supervision (KRISS) for Biomedical Entity Linking
Usage code for the entity linking approach described in the following paper:
```bibtex
@article{kriss,
author = {Sheng Zhang, Hao Cheng, Shikhar Vashishth, Cliff Wong, Jinfeng Xiao, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, Hoifung Poon},
title = {Knowledge-Rich Self-Supervision for Biomedical Entity Linking},
year = {2021},
url = {https://arxiv.org/abs/2112.07887},
eprinttype = {arXiv},
eprint = {2112.07887},
}
```
[https://arxiv.org/pdf/2112.07887.pdf](https://arxiv.org/pdf/2112.07887.pdf)
## Usage of KRISS for Entity Linking
Here, we use the [MedMentions](https://github.com/chanzuckerberg/MedMentions) data to show you how to 1) generate prototype embeddings, and 2) run entity linking.
(We are currently unable to release the self-supervised mention examples, because they requires UMLS and PubMed licenses.)
### 1. Create conda environment and install requirements
```bash
conda create -n kriss -y python=3.8 && conda activate kriss
pip install -r requirements.txt
```
### 2. Download the MedMentions dataset
```bash
git clone https://github.com/chanzuckerberg/MedMentions.git
```
### 3. Generate prototype embeddings
```bash
python generate_prototypes.py
```
### 4. Run entity linking
```bash
python run_entity_linking.py
```