This repository is the code part of the CMPUT 692 class project: A study of out-of-KB entities.
pip install spacy
python -m spacy download en_core_web_md
pip install -U sentence-transformers
pip install torch
pip install numpy
pip install tqdm
After downloading, unzip and put in the corresponding directory.
cd open_world
python OOKB_entities_recognition.py
The program will ask for a file name. A sample document is in open_world/example_text/sample.txt
Thanks to OpenKE KGC framework
cd openKE_scripts/openke
bash make.sh
cd ..
python train_transe300D_DBpedia50k.py
cd open-world
python run_open_world.py --mode train
cd open-world
python run_open_world.py --mode benchmark
Prepare a file with the following format:
First line: ID of the relation
Second line: description of the entity
cd open-world
python run_open_world.py --mode predict --file [filename]
A sample file is in open_world/example_text/test_predict.txt
- Training the closed-world model using OpenKE (https://github.com/thunlp/OpenKE)
- Inspired by the OWE model (https://github.com/haseebs/OWE)