darrenyaoyao / ResCNN_RelationExtraction

Deep Residual Learning for Weakly-Supervised Relation Extraction: https://arxiv.org/abs/1707.08866
105 stars 40 forks source link

数据处理请问 #5

Open Mariobai opened 6 years ago

Mariobai commented 6 years ago

W = tf.Variable(tf.random_uniform([62, 5], minval=-math.sqrt(6/(3position_size+3embedding_size)), maxval=math.sqrt(6/(3position_size+3embedding_size))), name="W") 这几行代码的功能是为了干什么啊?

darrenyaoyao commented 6 years ago

您好: 這是用來初始化參數的。但現在初始化參數的方式也有很多種了,不一定要用我這種方法。我這種方式是Xavier initialization。 Mario notifications@github.com於 2018年1月14日 週日,下午3:35寫道:

W = tf.Variable(tf.random_uniform([62, 5], minval=-math.sqrt(6/(3position_size+3embedding_size)), maxval=math.sqrt(6/(3position_size+3embedding_size))), name="W") 这几行代码的功能是为了干什么啊?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/darrenyaoyao/ResCNN_RelationExtraction/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/APs-rma1wTFxHWVvTU6HlI6CahUnfqVJks5tKa4hgaJpZM4Rdgb1 .

Mariobai commented 6 years ago

W = tf.Variable(tf.random_uniform([62, 5])这里的62和5,分别表示的是什么啊?

self.input_x_p1 = tf.nn.embedding_lookup(W, self.input_p1) self.input_x_p2 = tf.nn.embedding_lookup(W, self.input_p2) 那位置向量为什么要去W中找呢?它的值应该是一个固定整数值啊,距离两个实体之间的相对距离。

pooled = tf.nn.max_pool( h, ksize=[1, sequence_length - filter_size + 1, 1, 1], strides=[1, 1, 1, 1], padding='VALID', name="pool") 还有这里的ksize=[1, sequence_length - filter_size + 1, 1, 1], ksize中的sequence_length - filter_size 表示的是什么意思啊?

Mariobai commented 6 years ago

您好,我想问一下,我在使用你的模型时,在进行预测的时候,模型的给出的预测值,总是一个固定值,没有变化,我想请问一下,这个是什么问题。

darrenyaoyao commented 6 years ago

您好: 這個問題,看起來是代碼裡有bug,可能是輸入的值錯了,導致每次輸出都一樣。可以再檢查一下,你是直接用我的程式碼嗎? Mario notifications@github.com於 2018年3月1日 週四,下午4:42寫道:

您好,我想问一下,我在使用你的模型时,在进行预测的时候,模型的给出的预测值,总是一个固定值,没有变化,我想请问一下,这个是什么问题。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/darrenyaoyao/ResCNN_RelationExtraction/issues/5#issuecomment-369517043, or mute the thread https://github.com/notifications/unsubscribe-auth/APs-rs8Ar5-AGcerFdxknkdQQt9TK4Daks5tZ7R_gaJpZM4Rdgb1 .

Mariobai commented 6 years ago

还有DataManager.py文件中for i, w in enumerate(words): a = i-l1 b = i-l2 if a > 30: a = 30 if b > 30: b = 30 if a < -30: a = -30 if b < -30: b = -30 p11.append(a+31) p22.append(b+31) 这个地方是求每个词距离实体之间的相对位置,为什么要加上31?还要上面的30是什么意思啊?如果我的句子长度变化了,这个地方的值应该怎么变动?

mzj123456 commented 6 years ago

您好!我想问一下 self.input_x_p1 = tf.nn.embedding_lookup(W, self.input_p1) self.input_x_p2 = tf.nn.embedding_lookup(W, self.input_p2) 位置向量为什么要去W中找呢?

weilonghu commented 6 years ago

您好!我想问一下,您们提供的训练集含有570088条句子,而论文中说只有522611条句子,并且train.txt和test.txt还有相同的实体关系对。请问您们做了处理吗?

ZhixiuYe commented 6 years ago

@knightBoy @darrenyaoyao +1