rktamplayo / entity2topic Goto Github PK
View Code? Open in Web Editor NEW[NAACL2018] Entity Commonsense Representation for Neural Abstractive Summarization
[NAACL2018] Entity Commonsense Representation for Neural Abstractive Summarization
Hi,
I've read your paper "Entity Commonsense Representation for Neural Abstractive Summarization`. Good idea. However, I'm a little confused about the implementation of the selective disambiguation module in your code.
where e_{i}
is the entity embedding vector, e^{'}_{i}
is the new entity vector after disambiguating encoder (where globally or locally)
I mean e^{'}_{i}
is entity_vector
, where d
in your formula is a scalar. e_{i}
is entity_proj
d = \sigma(W_d e^{'}_{i} + b_{d}
equals to
Wt = tf.get_variable("Wt", [1000, 1], initializer=xavier_initializer())
bt = tf.Variable(tf.constant(0.0, shape=[1]))
t = tf.nn.sigmoid(tf.tensordot(entity_vector, Wt, 1) + bt)
here f
you use tanh
, then
f(W_x e_{i} + b_x)
equals to
Wh = tf.get_variable("Wh", [1000, 1000], initializer=xavier_initializer())
bh = tf.Variable(tf.constant(0.0, shape=[1000]))
entity_proj = tf.nn.tanh(tf.tensordot(entity_proj, Wh, 1) + bh)
I'm doubting whether following implementation equals to d * f(W_x e_{i} + b_x) + (1-d)* f(W_y e^{'}_{i} + b_y)
entity_vector = t*entity_vector + (1-t)*entity_proj
I mean the correct implementation should be
Wy = tf.get_variable("Wy", [1000, 1000], initializer=xavier_initializer())
by = tf.Variable(tf.constant(0.0, shape=[1000]))
entity_vector = tf.nn.tanh(tf.tensordot(entity_vector, Wy, 1) + by)
entity_vector = t*entity_vector + (1-t)*entity_proj
code snippet in bigru_model.py
if highway:
# y
# entity_proj = entity_inputs_emb[:,3:-3,:]
Wh = tf.get_variable("Wh", [1000, 1000], initializer=xavier_initializer())
bh = tf.Variable(tf.constant(0.0, shape=[1000]))
entity_proj = tf.nn.tanh(tf.tensordot(entity_proj, Wh, 1) + bh)
if not forward_only:
entity_proj.set_shape([self.batch_size, None, 1000])
else:
entity_proj.set_shape([self.batch_size*10, None, 1000])
if not forward_only:
entity_proj = tf.nn.dropout(entity_proj, keep_prob=0.5)
# t
Wt = tf.get_variable("Wt", [1000, 1], initializer=xavier_initializer())
bt = tf.Variable(tf.constant(0.0, shape=[1]))
t = tf.nn.sigmoid(tf.tensordot(entity_vector, Wt, 1) + bt)
if not forward_only:
t.set_shape([self.batch_size, None, 1000])
else:
t.set_shape([self.batch_size*10, None, 1000])
self.t = t
entity_vector = t*entity_vector + (1-t)*entity_proj
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.