Data

Usage

  1. Download and unzip the NYT10 data and put it in the current folder.
  2. Delete test.txt and random sample 20% items from train.txt as the new test.txt.
  3. Download en_core_web_lg or en_core_web_sm of spaCy and put it in the current folder.
  4. Put corpus into the data folder.
  5. Put the target relation set into the data folder.
  6. Run wikidataautolabelling.py.
python3 wikidataautolabelling.py
  1. Run preprocess.py.
  2. 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'
  1. Run draw.py to visualize the results.
python3 draw.py