# Bart summarization

**URL:** <https://discuss.huggingface.co/t/bart-summarization/636>\
**Category:** Beginners\
**Created:** [August 8, 2020, 11:49am UTC](https://discuss.huggingface.co/t/bart-summarization/636 "2020-08-08T11:49:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hildweig](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hildweig/32/190_2.png) [@Hildweig](https://discuss.huggingface.co/u/Hildweig)\
**Post date:** [August 8, 2020, 11:49am UTC](https://discuss.huggingface.co/t/bart-summarization/636/1 "2020-08-08T11:49:59Z")

</div>

Good morning/evening  
I am trying to understand how does distilbart generate summaries, like what is the logic behind when you fine tune it with texts and their reference summaries, how does it learn to summarize with a specified length with new words? The way I see it is: I feed a text into the model, it gets encoded & then decoded with only the tokens containing important information? How does the model spots kinda the good sentences tokens?

---

<div class="post-metadata">

**Author:** ![astariul](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@astariul](https://discuss.huggingface.co/u/astariul)\
**Post date:** [August 10, 2020, 1:10am UTC](https://discuss.huggingface.co/t/bart-summarization/636/2 "2020-08-10T01:10:08Z")

</div>

You should read more about “Sequence to Sequence”.

Bart is a seq2seq model : the input text is encoded with attention, and then output text is generated token by token, with attention over the input and the generated output so far. Since the output is generated token by token, we can choose how many token we want to generate.

---

<div class="post-metadata">

**Author:** ![Jung](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jung/32/21989_2.png) [@Jung](https://discuss.huggingface.co/u/Jung)\
**Post date:** [August 10, 2020, 3:06am UTC](https://discuss.huggingface.co/t/bart-summarization/636/3 "2020-08-10T03:06:49Z")

</div>

Yes as @astariul said. And learn from the master is one of the best way 🙂  
Here’s Andrew Ng Video Series on Seq2Seq model :

https://www.youtube.com/embed/_i3aqgKVNQI?feature=oembed&wmode=opaque&list=PLkDaE6sCZn6F6wUI9tvS_Gw1vaFAx6rd6

Even though it’s not transformer, but the big picture concept is applicable .

---

<div class="post-metadata">

**Author:** ![Hildweig](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hildweig/32/190_2.png) [@Hildweig](https://discuss.huggingface.co/u/Hildweig)\
**Post date:** [August 10, 2020, 1:57pm UTC](https://discuss.huggingface.co/t/bart-summarization/636/4 "2020-08-10T13:57:41Z")

</div>

Thank you very much, I will!
