Giter Site home page Giter Site logo

Comments (7)

huseinzol05 avatar huseinzol05 commented on July 21, 2024 2

BERTSUM just a feeding technique, i am serious, I study the code to translate to Tensorflow.

Screenshot 2019-09-23 at 5 12 52 PM

from presumm.

robinsongh381 avatar robinsongh381 commented on July 21, 2024 1

Thanks for your reply.

Can we still use use_position_embeddings, with the input sequence length greater than 512 ?
In my opinion, 512 is just a hyper-parameter and we can simply change it to another value.

Back to my question, you still do not provide answers to my question.

As you said, if BertSum is just a way of modifying input, rather than a new way of pre-training, I don't see that the former definition of BertSum can capture the true meaning of CLS token.

Without re-pre-training Bert with BertSum input architecture, your suggestion of BertSum won't understand the true meaning of CLS tokens for inputs longer than 2 sentences.

Please correct me if I am wrong.

Regards

from presumm.

robinsongh381 avatar robinsongh381 commented on July 21, 2024

Are you sure ?

If you just change the way of constructing an input (i.e/ (1) Add CLS tokens in the beginning of each and (2) interval segment embeddings) and use the pretrained BERT whose input involves in only one CLS token for each input, how do we get meaningful output ?

I thought that we need to "pretrain again" with the BERTSUM feeding method against MLM and NSP ?!

What do u think @huseinzol05 ?

from presumm.

huseinzol05 avatar huseinzol05 commented on July 21, 2024

Nope, no need. It is literally just constructing the inputs. I reversed engineered the code to Tensorflow already.

from presumm.

robinsongh381 avatar robinsongh381 commented on July 21, 2024

@huseinzol05
I am surprised !
Is there any chance that you could possibly share the tensorflow code ?
That would be greatly helpful for my understanding

from presumm.

huseinzol05 avatar huseinzol05 commented on July 21, 2024

This is preprocessing and tokenization, https://github.com/huseinzol05/NLP-Models-Tensorflow/blob/master/extractive-summarization/preprocessing-data-bert.ipynb

This is the model, https://github.com/huseinzol05/NLP-Models-Tensorflow/blob/master/extractive-summarization/4.bert-base.ipynb

I got bad result for now,

  1. I disable use_position_embeddings inside https://github.com/huseinzol05/NLP-Models-Tensorflow/blob/master/extractive-summarization/modeling.py#L190

Original implementation is using use_position_embeddings. Problem if we implemented use_position_embeddings, max length BERT can accept is 512 length, and obviously, some texts we want to summarize longer than that.

If we check how nlpyang/PreSumm tackle this issue, https://github.com/nlpyang/PreSumm/blob/master/src/models/model_builder.py#L150 , nlpyang/PreSumm repeat after 512, and that pytorch code is unable to done it tensorflow.

from presumm.

huseinzol05 avatar huseinzol05 commented on July 21, 2024

Can we still use use_position_embeddings, with the input sequence length greater than 512 ? In my opinion, 512 is just a hyper-parameter and we can simply change it to another value.
We can't, use_position_embeddings in Tensorflow code will exception if sequence longer than 512.

As you said, if BertSum is just a way of modifying input, rather than a new way of pre-training, I don't see that the former definition of BertSum can capture the true meaning of CLS token..
It will learn during transfer learning extractive / abstractive summarization. We know original BERT can capture 2 sentences by putting CLS token, example, text similarity transfer learning. BERTSUM just added CLS after N sentences, and during transfer learning, we give indices of CLS to let know BERTSUM when to gather output sequences to multiple output N sequences depends on CLS counts.

from presumm.

Related Issues (20)

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.