https://github.com/izuna385/zero-shot-entity-linking
Zero-shot Entity Linking with blitz start in 3 minutes. Hard negative mining and encoder for all entities are also included in this implementation.
https://github.com/izuna385/zero-shot-entity-linking
allennlp approximate-nearest-neighbor-search bert entity-linking faiss natural-language-processing zero-shot-learning zero-shot-retrieval
Last synced: 2 months ago
JSON representation
Zero-shot Entity Linking with blitz start in 3 minutes. Hard negative mining and encoder for all entities are also included in this implementation.
- Host: GitHub
- URL: https://github.com/izuna385/zero-shot-entity-linking
- Owner: izuna385
- License: mit
- Created: 2020-07-31T12:16:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T21:28:34.000Z (about 2 years ago)
- Last Synced: 2025-04-22T10:36:40.905Z (2 months ago)
- Topics: allennlp, approximate-nearest-neighbor-search, bert, entity-linking, faiss, natural-language-processing, zero-shot-learning, zero-shot-retrieval
- Language: Python
- Homepage:
- Size: 212 KB
- Stars: 31
- Watchers: 2
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dual-Encoder-Based Zero-Shot Entity Linking
## Quick Starts in 3 minutes```
git clone https://github.com/izuna385/Zero-Shot-Entity-Linking.git
cd Zero-Shot-Entity-Linking
python -m spacy download en_core_web_sm# ~ Multiprocessing Sentence Boundary Detection takes about 2 hours under 8 core CPUs.
sh preprocessing.sh
python3 ./src/train.py -num_epochs 1
```
For further speednizing to check entire script, run the following command.`python3 ./src/train.py -num_epochs 1 -debug True`
also, multi-gpu is supported.
`CUDA_VISIBLE_DEVICES=0,1 python3 ./src/train.py -num_epochs 1 -cuda_devices 0,1`
## Descriptions
* This experiments aim to confirm whether fine-tuning pretraind BERT (more specifically, encoders for mention and entity) is effective even to the unknown domains.
* Following [[Logeswaran et al., '19]](https://github.com/lajanugen/zeshel), entities are not shared between train-dev and train-test.
* If you are interested in what this repository does, see the original paper, or unofficial slides.
* [Original paper](https://arxiv.org/abs/1911.03814)
* [Unofficial slides](https://speakerdeck.com/izuna385/zero-shot-entity-linking-with-dense-entity-retrieval-unofficial-slides-and-entity-linking-future-directions)
# Requirements
* `torch`,`allennlp`,`transformers`, and `faiss` are required. See also `requirements.txt`.* ~3 GB CPU and ~1.1GB GPU are necessary for running script.
# How to run experiments
## 1. Preprocessing
* Run `sh preprocessing.sh` at this directory.
* The Datasets are derived from [[Logeswaran et al., '19]](https://github.com/lajanugen/zeshel).
## 2. Training and Evaluate Bi-Encoder Model
* `python3 ./src/train.py`
* This script trains encoder for mention and entity.
[]()
## 3. Logging Each Experiment
* See `./src/experiment_logdir/`.
* Log directory is named after when the experiment starts.
## TODO
* Preprocess with more strict sentence boundary.
# LICENSE
* MIT