File size: 1,335 Bytes
e3ef0b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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
```