Giter Club home page Giter Club logo

attention-based-bilstm-relation-extraction's People

Contributors

roomylee avatar seosangwoo 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  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  avatar  avatar  avatar

attention-based-bilstm-relation-extraction's Issues

How to run?

How would you go about running this so one could input a given text of choice to determine the semantic relations within?

I've looked through and can't seem to identify any way in which to do this.

Thanks in advance.

ValueError: not enough values to unpack (expected 7, got 5)

x_dev: (800, 4, 98)!!
x_dev: (4, 800, 98)!!
Train/Dev split: 7200/800

2018-06-02 20:32:13.323599: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
(<tf.Tensor 'bidirectional_rnn/fw/fw/transpose_1:0' shape=(?, 98, 800) dtype=float32>, <tf.Tensor 'ReverseV2:0' shape=(?, 98, 800) dtype=float32>)
pos: (?, 98)
WARNING:tensorflow:From /home/mldl/ub16_prj/Attention-Based-BiLSTM-relation-extraction/lstm_attention.py:69: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

Writing to /home/mldl/ub16_prj/Attention-Based-BiLSTM-relation-extraction/runs/1527942734

Traceback (most recent call last):
File "train.py", line 264, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "train.py", line 261, in main
train(x_text, dist1, dist2, y, pos)
File "train.py", line 248, in train
train_step(x_batch, y_batch)
File "train.py", line 204, in train_step
feed_dict)
ValueError: not enough values to unpack (expected 7, got 5)
(venv) mldl@mldlUB1604:~/ub16_prj/Attention-Based-BiLSTM-relation-extraction$ /usr/bin/python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import tensorflow as tf
tf.version
'1.8.0'
quit()
(venv) mldl@mldlUB1604:

tf.keras.initializers.glorot_normal()

in train.py and attention.py have function:tf.keras.initializers.glorot_normal()
but my tensorflow do not have attribute keras
could i do some to replace this function?
thanks a lot

contact information

I am currently studying relationship extraction. Can you leave a contact information ,so i can discuss it with you?

relation2id

thank you very much,
Can you share the complete data set?And explain the order in which the codes runs?

the best official score?

Please,how many F1 (the official score) do you obtain with the provided code?0.84?how to set the Hyperparameter?

glorot_normal() got an unexpected keyword argument

i use tensenflow 1.8.0 but the tf.keras.initializers.glorot_normal is not good
TypeError: glorot_normal() got an unexpected keyword argument 'dtype'
TypeError: glorot_normal() got an unexpected keyword argument 'partition_info'

i want to know the cause
thanks a lot

unofficial F1 only 0.694117

Hi SeoSangwoo.I run this code,but the Macro-Average F1 Score (excluding Other) is 0.694117.I noticed that official label range is(1,10),but here is(1,19),does it cause F1 lower than paper(0.84).

can`t reach the F1 80.4

hi , SeoSangwoo, when i run your code , the result of f1 is 81.56, but the paper of f1 is 84 , how about your socre finally?

请问spos[pos1] = spos[pos2] = 2的作用是啥

spos = np.zeros(MAX_SENTENCE_LENGTH)#一个向量
spos[pos1] = spos[pos2] = 2; pos.append(spos)

这个pos在Attention里用到,却只是
if vu.shape == pos.shape: vu = tf.add(vu, pos)
之后却没有使用,这个对应论文里面的哪一点,哪一个变量呢

Questions to ask

Hello,SeoSangwoo!Thank you for sharing such valuable code. I would like to ask you a question about the code,why did you use tf.reduce_sum here to reduce dimensions?is it the beat way?
I would appreciate it if you could answer my questions.

output = tf.reduce_sum(inputs * tf.expand_dims(alphas, -1), 1)

train.py 参数问题求解答

train.py 文件中,第200行有7个参数,201行为什么只有5个参数了,运行时报错,能解释一下为什么吗?谢谢

which version of tensorflow it should be?

Writing to /Users//Attention-Based-BiLSTM-relation-extraction/runs/1526525946

Traceback (most recent call last):
File "train.py", line 262, in
tf.app.run()
File "/usr/local/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train.py", line 259, in main
train(x_text, dist1, dist2, y, pos)
File "train.py", line 246, in train
train_step(x_batch, y_batch)
File "train.py", line 202, in train_step
feed_dict)

when use python3 train.py I got a problem like this: " ValueError: Input 0 of layer dense_1 is incompatible with the layer: its rank is undefined, but the layer requires a defined rank."

Train/Dev split: 7200/800

Traceback (most recent call last):
File "/Users/wuxikun/Downloads/Attention-Based-BiLSTM-relation-extraction-master/train.py", line 162, in
tf.app.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "/Users/wuxikun/Downloads/Attention-Based-BiLSTM-relation-extraction-master/train.py", line 158, in main
train()
File "/Users/wuxikun/Downloads/Attention-Based-BiLSTM-relation-extraction-master/train.py", line 61, in train
l2_reg_lambda=FLAGS.l2_reg_lambda)
File "/Users/wuxikun/Downloads/Attention-Based-BiLSTM-relation-extraction-master/att_lstm.py", line 49, in init
self.logits = tf.layers.dense(self.h_drop, num_classes, kernel_initializer=initializer())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/layers/core.py", line 253, in dense
return layer.apply(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 762, in apply
return self.call(inputs, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 629, in call
self._assert_input_compatibility(inputs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 1122, in _assert_input_compatibility
self.name + ' is incompatible with the layer: '
ValueError: Input 0 of layer dense_1 is incompatible with the layer: its rank is undefined, but the layer requires a defined rank.

Process finished with exit code 1

I guess it cause by the function attention(inputs) which return an output with unknown shape, how can I fix it ? or would you please tell me my mistaken ?

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.