GithubHelp home page GithubHelp logo

rktamplayo / entity2topic Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 8.0 26 KB

[NAACL2018] Entity Commonsense Representation for Neural Abstractive Summarization

Python 100.00%
entity-commonsense-representation summarization text-summarization document-summarization abstractive-summarization machine-learning deep-learning natural-language-processing natural-language-generation text-generation

entity2topic's People

Contributors

rktamplayo avatar

Stargazers

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

Watchers

 avatar  avatar

entity2topic's Issues

Implementation of selective disambiguation

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.

image

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

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.