- Download and unzip the
NYT10
data and put it in the current folder.
- Delete
test.txt
and random sample 20% items from train.txt
as the new test.txt
.
- Download
en_core_web_lg
or en_core_web_sm
of spaCy and put it in the current folder.
- Put corpus into the
data
folder.
- Put the target relation set into the
data
folder.
- Run
wikidataautolabelling.py
.
python3 wikidataautolabelling.py
- Run
preprocess.py
.
- Run the following concands.
python3 run.py --encoder='cnn' --selector='one'
python3 run.py --encoder='cnn' --selector='att'
python3 run.py --encoder='cnn' --selector='avg'
python3 run.py --encoder='pcnn' --selector='one'
python3 run.py --encoder='pcnn' --selector='att'
python3 run.py --encoder='pcnn' --selector='avg'
- Run
draw.py
to visualize the results.