GithubHelp home page GithubHelp logo

daiquocnguyen / convkb Goto Github PK

View Code? Open in Web Editor NEW
203.0 203.0 39.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%
convolutional-neural-network fb15k237 knowledge-base-completion knowledge-base-embeddings knowledge-graph-completion knowledge-graph-embeddings knowledge-graphs link-prediction pytorch-implementation wn18rr

convkb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

convkb's Issues

Issue try running the code

Hi there,

When I tried running "python train.py --embedding_dim 100 --num_filters 50 --learning_rate 0.000005 --name FB15k-237 --useConstantInit --model_name fb15k237", It seems the program does not create a new "runs" directory. Do you guys know why?

no suitable image found. Did find:

`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
Namespace(checkpoint_path=None, dataset='FB15K237', dropout=0.5, hidden_size=100, kernel_size=1, learning_rate=0.01, lmbda=0.1, lmbda2=0.01, mode='train', model_name='FB15K237_lda-0.1_nneg-10_nfilters-128_lr-0.01', nbatches=100, neg_num=10, num_epochs=300, num_of_filters=128, optim='adagrad', save_steps=1000, test_file='', use_init=1, valid_steps=50)
Writing to /Users/***/Downloads/ConvKB-master/runs_pytorch_ConvKB

Traceback (most recent call last):
File "train_ConvKB.py", line 42, in
con = Config()
File "/Users//Downloads/ConvKB-master/ConvKB_pytorch/Config.py", line 34, in init
self.lib = ctypes.cdll.LoadLibrary(base_file)
File "/Users/
/opt/anaconda3/lib/python3.7/ctypes/init.py", line 442, in LoadLibrary
return self._dlltype(name)
File "/Users//opt/anaconda3/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/
/Downloads/ConvKB-master/ConvKB_pytorch/release/Base.so, 6): no suitable image found. Did find:
/Users//Downloads/ConvKB-master/ConvKB_pytorch/release/Base.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
/Users/
/Downloads/ConvKB-master/ConvKB_pytorch/release/Base.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00`

  • MacOS
  • torch 1.7.0
  • when i run the command get above error
  • why and how to fix ?

How to implement ConvKB on triplet classification

Hi,
I have read your paper of http://www.semantic-web-journal.net/system/files/swj1867.pdf and found you have implemented ConvKB on the triplet classification task.
I tried to implement it by myself on WN11 dataset but I failed: the model can't fit test set and dev set.I guess the key is about the score function and threshold .
So I would appreciate it if you can provide the code on the task so that I can find where the mistake is.
Thanks a lot!

Hyperparameter settings for different datasets

I tried to use the hyperparameters for FB15K_237 to train NELL_995 but the results (hit-10 42.1%) are far below the benchmarks given in the KBAT paper (hit-10 54.5%). So I want to ask are there any other golden hyperparameter settings for different datasets, such as NELL_995?
Thanks.

Training on FB15k-237 without pre-trained embeddings.

Hi,
I am unable to reproduce the results reported on FB15k-237 without using the given pre-trained embeddings. Also, providing --pre-trained as True/False doesn't make any difference because in either case it is set to True (reference). The provided training command for FB15k-237 is

python train.py --embedding_dim 100 --num_filters 50 --learning_rate 0.000005 --name FB15k-237 --useConstantInit --model_name fb15k237

This uses a very small learning rate (almost 0), so basically it is not changing the provided pre-trained embeddings during training. Please provide the hyperparameters you used for learning the pre-trained embeddings.

Thanks in advance

No file named 'model-200.eval.0.txt'

Thank you for your code, it helps me a lot!
I am a fresh man, and my English is really poor,
I run the code following your README
when I run the eval code, there is an error like this:

[FileNotFoundError]: No such file or directory: 'XXX/runs/fb15k237/checkpoints/model-200.eval.0.txt'

In the directory "checkpoints",there are
checkpoint model-200.data-00000of-00001 model-200.index model-200.meta
four files

Installation Environment

Hello, when I reproduced your model in windows system, "[WinError 193] %1 is not a valid Win32 application." This error, I would like to ask you, you are running the model using 64-bit python and anaconda?

bugs in eval.py

I used your code in my project and found that calculated MRR is greater than 1. I'm not sure that your code is implemented correctly or not.

About python train.py

Hi,
When i run ' CUDA_VISIBLE_DEVICES =2 python train.py --embedding_dim 100 --num_filters 400 --learning_rate 0.00005 --name WN18RR --num_epochs 101 --saveStep 100 --model_name wn18rr_400_3',
why the program stays on ‘Writing to /home/***/code/runs/fb15k237’,and the GPU-Util is 0
the 'checkpoints' is empty
thanks!

Interpretability of results/test

Hi, appreciate your work on knowledge graphs!

After running the code (in PyTorch) I do not get a h@10, MR or MRR.
Am I interpreting the results of wrongly, or are they not printed?

Best regards

image

a problem in the eval.py

I find a problem in the eval.py. when the scores of these entities are same, the ranking of the all entities are 1. Can you explain this?

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.