Skip to content

NYSDY/Describing_a_Knowledge_Base

 
 

Repository files navigation

Describing a Knowledge Base

Describing a Knowledge Base

Accepted by 11th International Conference on Natural Language Generation (INLG 2018)

Table of Contents

Model Overview

Photo

Requirements

Environment:

  • Pytorch 0.4
  • Python 3.6 CAUTION!! Model might not be saved and loaded properly under Python 3.5

Data:

  • Wikipedia Person and Animal Dataset
    This dataset gathers unfiltered 428,748 person and 12,236 animal infobox with description based on Wikipedia dump (2018/04/01) and Wikidata (2018/04/12)

Quickstart

Preprocessing: Put the Wikipedia Person and Animal Dataset under the Describing a Knowledge Base folder. Unzip it.

Randomly split the data into train, dev and test by runing split.py under utils folder.

python split.py

Run preprocess.py under the same folder.

You can choose person (type 0) or animal (type 1)

python preprocess.py --type 0

Training

Hyperparameter can be adjust in the Config class of main.py and choose whether person or animal using type.

python main.py --cuda --mode 0 --type 0

Test

Compute score:

python main.py --cuda --mode 3

Predict single entity:

python main.py --cuda --mode 1

Citation

@InProceedings{wang1y2018,
  author = 	"Wang, Qingyun
             and Pan, Xiaoman
             and Huang, Lifu
             and Zhang, Boliang
             and Jiang, Zhiying
             and Ji, Heng
             and Knight, Kevin",
  title = 	"Describing a Knowledge Base",
  booktitle = 	"Proceedings of the 11th International Conference on Natural Language Generation ",
  year = 	"2018"
}

Attention Visualization

Photo

Photo

About

Code for Describing a Knowledge Base

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%