GithubHelp home page GithubHelp logo

lijie0610 / convkb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daiquocnguyen/convkb

0.0 0.0 0.0 64.99 MB

A Novel Embedding Model for Knowledge Base Completion Based on Convolutional Neural Network (NAACL 2018) (Pytorch and Tensorflow)

License: Apache License 2.0

Python 69.85% Shell 1.82% C++ 12.68% Objective-C 2.68% C 12.97%

convkb's Introduction

A Novel Embedding Model for Knowledge Base Completion Based on Convolutional Neural NetworkTwitter

GitHub top languageGitHub issues GitHub repo size GitHub last commit GitHub forks GitHub stars GitHub

This program provides the implementation of the CNN-based model ConvKB for knowledge graph embeddings as described in the paper. ConvKB uses a convolution layer with different filters of the same 1 ร— 3 shape and then concatenates output feature maps into a single vector which is multiplied by a weight vector to produce a score for the given triple.

Usage

News

  • June 13, 2020: Update Pytorch (1.5.0) implementation. The ConvKB Pytorch implementation, which is based on the OpenKE framework, is to deal with the issue #5.

  • May 30, 2020: The Tensorflow implementation was completed approximately three years ago, and now it is out-of-date.

  • March 06, 2018: Note that our Tensorflow implementation can leverage different filters of different n ร— 3 shapes, so we can tune the hyper-parameter n. In our paper, we set n to 1 for simplification.

Requirements

  • Python 3.6
  • Pytorch 1.5.0 or Tensorflow 1.6

Training

Regarding the Pytorch implementation, you should run ''bash make.sh'' to compile the base package and then use the commands as:

$ python train_ConvKB.py --dataset WN18RR --hidden_size 50 --num_of_filters 64 --neg_num 10 --valid_step 50 --nbatches 100 --num_epochs 300 --learning_rate 0.01 --lmbda 0.2 --model_name WN18RR_lda-0.2_nneg-10_nfilters-64_lr-0.01 --mode train

$ python train_ConvKB.py --dataset FB15K237 --hidden_size 100 --num_of_filters 128 --neg_num 10 --valid_step 50 --nbatches 100 --num_epochs 300 --learning_rate 0.01 --lmbda 0.1 --model_name FB15K237_lda-0.1_nneg-10_nfilters-128_lr-0.01 --mode train
Dataset MR MRR Hits@10
WN18RR 2741 0.220 50.8
FB15K-237 196 0.302 48.3

Cite

Please cite the paper whenever ConvKB is used to produce published results or incorporated into other software:

@inproceedings{Nguyen2018,
  author={Dai Quoc Nguyen and Tu Dinh Nguyen and Dat Quoc Nguyen and Dinh Phung},
  title={A Novel Embedding Model for Knowledge Base Completion Based on Convolutional Neural Network},
  booktitle={Proceedings of the 16th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT)},
  pages={327--333},
  year={2018}
}

License

Please cite the paper whenever ConvKB is used to produce published results or incorporated into other software. I would highly appreciate to have your bug reports, comments and suggestions about ConvKB. As a free open-source implementation, ConvKB is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

ConvKB is licensed under the Apache License 2.0.

convkb's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.