Git Product home page Git Product logo

kim's People

Contributors

lukecq1231 avatar

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

Watchers

 avatar  avatar  avatar

kim's Issues

Google drive

hello
I put project at google drive. How do I run the code on Google Colab?
please help me.

Model

Hi, could you kindly share your model? I am having difficulty in running the GPU version of the code due to some cuda version incompatibilities. If you can upload your pre-trained model somewhere, it will be highly appreciated. Thanks!

Lexical Semantic Relations Confusion

您的论文中在4.1中说同义词的识别[dog,wolf]=0,共享上位词 [dog,wolf]=1,
然后对于五维的关系特征利用公式4的indication function进行计算。可是例如词对是dog,wolf的时候,这种方式是无法识别entailment还是contradiction的。不知自己理解是否有误,期待您的回复。

硬件资源问题

您好,我在32核cpu和64G内存的服务器上运行您的代码,在训练两个小时左右就中断了,应该是内存不足,服务器强制中断了。
请问在cpu下可以运行成功吗,需要多少内存才可以?还有您是在GPU下运行的吗,如果要在GPU下运行,需要什么样的GPU配置,多少显存才可以。
希望您能给予解答,万分感谢!

valueError in log.txt

hello.
I run project in colab google.
I have python 2 and theano 0.9.0 .
But I see valueError in file log.txt.
what is problem?

In file included from mod.cu:10:0:
/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/cuda_ndarray.cuh:53:10: fatal error: cublas_v2.h: No such file or directory
#include <cublas_v2.h>

['nvcc', '-shared', '-O3', '-m64', '-Xcompiler', '-DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden', '-Xlinker', '-rpath,/root/.theano/compiledir_Linux-4.14.65+-x86_64-with-Ubuntu-18.04-bionic-x86_64-2.7.15rc1-64/cuda_ndarray', '-I/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda', '-I/usr/local/lib/python2.7/dist-packages/numpy/core/include', '-I/usr/include/python2.7', '-I/usr/local/lib/python2.7/dist-packages/theano/gof', '-o', '/root/.theano/compiledir_Linux-4.14.65+-x86_64-with-Ubuntu-18.04-bionic-x86_64-2.7.15rc1-64/cuda_ndarray/cuda_ndarray.so', 'mod.cu', '-L/usr/lib', '-lcublas', '-lpython2.7', '-lcudart']
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -m64 -Xcompiler -DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden -Xlinker -rpath,/root/.theano/compiledir_Linux-4.14.65+-x86_64-with-Ubuntu-18.04-bionic-x86_64-2.7.15rc1-64/cuda_ndarray -I/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/theano/gof -o /root/.theano/compiledir_Linux-4.14.65+-x86_64-with-Ubuntu-18.04-bionic-x86_64-2.7.15rc1-64/cuda_ndarray/cuda_ndarray.so mod.cu -L/usr/lib -lcublas -lpython2.7 -lcudart')

ValueError: When compiling the inner function of scan the following error has been encountered: The initial state (outputs_info in scan nomenclature) of variable IncSubtensor{Set;:int64:}.0 (argument number 2) has dtype float32, while the result of the inner function (fn) has dtype float64. This can happen if the inner function of scan results in an upcast or downcast.

googleColab

hello!
I want run project at Google colab. but I cannot.

what is problem?

1

Adding breaking NLI dataset as benchmark

Hello,

Let me congratulate to you on great research efforts. I've tried to use the code against breaking NLI ( https://github.com/BIU-NLP/Breaking_NLI ). I modified preprocess_data.py file and use build_sequence and CoreNLP methods to prepare data to feed into the model. I manually checked files like *_token.txt and '*_lemma.txt' and they look OK to me.

To evaluate a model on the new dataset, I changed gen.py file adding new TextIterator object and calling pred_acc function.

These are the results I get:
kim_accuracies_test 0.886
kim_accuracies_train 0.931
kim_accuracies_valid 0.887
kim_accuracies_breaking 0.109

Do you have any ideas why the number is so low?

Thanks

save model

Hello.
I lowered the amount of data and implemented the program with CPU but got the following results.
Why did not save the model and make the last line of the error ?

what is cost?

image

Default parameters

Hello,

Why kb_composition is set to False and attention_lambda = 0 as default?

Thank you,
Tomasz

Dependency issues

Hello.
I am having issue running the code.

When calling

np.core.multiarray._get_ndarray_c_version())

I got

AttributeError: ('The following error happened while compiling the node', DnnVersion(), '\n', "'module' object has no attribute '_get_ndarray_c_version'")

I have tried different versions of numpy and theano (including 0.9.0) but still failed.
Could you please show a list of packages that you ran the code with (pip freeze or conda list or equivalent)?
Thanks.

question:

hello.
I have python 2.7.15 and theano 1.0.3 .
By running the command "bash fetch_and_preprocess.sh" I encountered the following error. what is the reason?

Found SNLI dataset - skip
Found Glove vectors - skip
Found WordNet 3.0 - skip
Found Stanford CoreNLP - skip

Preprocessing WordNet prolog and SNLI dataset

  1. build dictionary of WordNet

Processing /home/aryan/Documents/kim-master/data/wordnet/prolog/wn_s.pl
number of phrases 0
size of word dictionary 84487
size of synset_id dictionary 92784
size of synset_id_num dictionary 138896
2. obtain relation features

hypernymy: 753086
hyponymy: 753086
co_hyponyms 3674700
antonymy: 6617
synonymy: 237937
relation features dim: 5
3. save to readable format (txt)

number of total relation features: 5368548
4. obtain train/dev/test dataset

snli_1.0_dev.txt
max min len premise 59 2
max min len hypothesis 55 2
snli_1.0_test.txt
max min len premise 57 2
max min len hypothesis 30 1
snli_1.0_train.txt
max min len premise 82 2
max min len hypothesis 62 1
5. obtain lemma format for train/dev/test dataset

Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_train.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_train_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_train_lemma.txt
sh: 1: java: not found
Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/
" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_train.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_train_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_train_lemma.txt
sh: 1: java: not found
Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_dev.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_dev_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_dev_lemma.txt
sh: 1: java: not found
Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/
" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_dev.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_dev_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_dev_lemma.txt
sh: 1: java: not found
Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_test.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_test_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_test_lemma.txt
sh: 1: java: not found
Run ...
java -cp ".:./corenlp/stanford-corenlp-full-2016-10-31/
" tokenize_and_lemmatize /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_test.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_test_token.txt /home/aryan/Documents/kim-master/data/sequence_and_features/hypothesis_snli_1.0_test_lemma.txt
sh: 1: java: not found
6. build dictionary for word sequence and lemma sequence from training set

Processing /home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_train_token.txt
Traceback (most recent call last):
File "preprocess_data.py", line 363, in
os.path.join(dst_dir, 'vocab_cased.pkl'), wordnet=word_id_num, remove_phrase=True)
File "preprocess_data.py", line 211, in build_dictionary
with open(filepath, 'r') as f:
IOError: [Errno 2] No such file or directory: '/home/aryan/Documents/kim-master/data/sequence_and_features/premise_snli_1.0_train_token.txt'

error in run

I have python 2 and theano 0.9.0
I run the following code:
!python2 /content/drive/'My Drive'/kim/scripts/kim/train.py
But I encountered the following error:
Traceback (most recent call last):
File "/content/drive/My Drive/kim/scripts/kim/train.py", line 4, in
from main import train
File "/content/drive/My Drive/kim/scripts/kim/main.py", line 4, in
import theano
File "/usr/local/lib/python2.7/dist-packages/theano/init.py", line 80, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/init.py", line 41, in
from theano.scan_module import scan_opt
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan_opt.py", line 60, in
from theano import tensor, scalar
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/init.py", line 9, in
from theano.tensor.subtensor import *
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/subtensor.py", line 27, in
from cutils_ext.cutils_ext import inplace_increment
ImportError: cannot import name inplace_increment

But when I install theano 1.0.0 , I encounter the following error

Loading knowledge base ...
2018-11-27 11:25:53,537: main: DEBUG: {'attention_lambda': 0,
'batch_size': 32,
'clip_c': 10.0,
'datasets': ['../../data/sequence_and_features/premise_snli_1.0_train_token.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_train_token.txt',
'../../data/sequence_and_features/premise_snli_1.0_train_lemma.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_train_lemma.txt',
'../../data/sequence_and_features/label_snli_1.0_train.txt'],
'decay_c': 0.0,
'decoder': 'lstm',
'dictionary': ['../../data/sequence_and_features/vocab_cased.pkl',
'../../data/sequence_and_features/vocab_cased_lemma.pkl'],
'dim': 300,
'dim_kb': 5,
'dim_word': 300,
'dispFreq': 100,
'embedding': '../../data/glove/glove.840B.300d.txt',
'encoder': 'lstm',
'finish_after': 10000000,
'kb_composition': False,
'kb_dicts': ['../../data/sequence_and_features/pair_features.pkl'],
'kb_inference': True,
'lrate': 0.0004,
'max_epochs': 5000,
'maxlen': 100,
'n_words': 110497,
'n_words_lemma': 100360,
'optimizer': 'adam',
'patience': 7,
'reload_': False,
'saveFreq': 17168,
'saveto': '../../models/kim.npz',
'test_datasets': ['../../data/sequence_and_features/premise_snli_1.0_test_token.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_test_token.txt',
'../../data/sequence_and_features/premise_snli_1.0_test_lemma.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_test_lemma.txt',
'../../data/sequence_and_features/label_snli_1.0_test.txt'],
'use_dropout': True,
'validFreq': 17168,
'valid_batch_size': 32,
'valid_datasets': ['../../data/sequence_and_features/premise_snli_1.0_dev_token.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_dev_token.txt',
'../../data/sequence_and_features/premise_snli_1.0_dev_lemma.txt',
'../../data/sequence_and_features/hypothesis_snli_1.0_dev_lemma.txt',
'../../data/sequence_and_features/label_snli_1.0_dev.txt'],
'verbose': False}
Loading data
Building model
Wemb (110497, 300)
encoder_W (300, 1200)
encoder_U (300, 1200)
encoder_b (1200,)
encoder_r_W (300, 1200)
encoder_r_U (300, 1200)
encoder_r_b (1200,)
decoder_W (305, 1200)
decoder_U (300, 1200)
decoder_b (1200,)
decoder_r_W (305, 1200)
decoder_r_U (300, 1200)
decoder_r_b (1200,)
projection_W (2405, 300)
projection_b (300,)
ff_layer_1_W (2400, 300)
ff_layer_1_b (300,)
ff_layer_output_W (300, 3)
ff_layer_output_b (3,)
Traceback (most recent call last):
File "/content/drive/My Drive/kim/scripts/kim/train.py", line 50, in
attention_lambda = 0,
File "/content/drive/My Drive/kim/scripts/kim/main.py", line 866, in train
build_model(tparams, model_options)
File "/content/drive/My Drive/kim/scripts/kim/main.py", line 552, in build_model
mask=x1_mask)
File "/content/drive/My Drive/kim/scripts/kim/main.py", line 356, in lstm_layer
n_steps=nsteps, profile=False)
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan.py", line 1076, in scan
scan_outs = local_op(*scan_inputs)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 615, in call
node = self.make_node(*inputs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan_op.py", line 546, in make_node
inner_sitsot_out.type.dtype))
ValueError: When compiling the inner function of scan the following error has been encountered: The initial state (outputs_info in scan nomenclature) of variable IncSubtensor{Set;:int64:}.0 (argument number 2) has dtype float32, while the result of the inner function (fn) has dtype float64. This can happen if the inner function of scan results in an upcast or downcast.
Please help me.

keras or tensorflow

Hello
Is there implementation of your code with the keras or TensorFlow library?
If you can give it to me?
thanks

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.