# How I fine-tune BART for summarization using large texts?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266%3E%5C
**Category:** Research\
**Created:** [September 27, 2020, 4:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266 "2020-09-27T04:02:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiagocmoreira](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@thiagocmoreira](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fthiagocmoreira)%5C
**Post date:** [September 27, 2020, 4:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266%2F1 "2020-09-27T04:02:21Z")

</div>

Good night!

I’m using a pre-trained Bart for summarization and I have my own dataset for fine-tuning (which has a set with the big text and its respective summary). Despite this, my input texts are approximately 2500 characters long and the maximum Bart accepts is 1024. Is there any technique I can use to use all text? I thought of splitting each cell into smaller texts (max 1024) and assigning the same summary to each. Makes sense?

Example:

Before:  
ABC: summary1  
DEF: summary2

After:  
A: summary1  
B: summary1  
C: summary1  
D: summary2  
E: summary2  
F: summary2

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvalhalla)%5C
**Post date:** [September 27, 2020, 7:00am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266%2F2 "2020-09-27T07:00:53Z")

</div>

Hi, there’e already thread for this, you might find it helpful

> [@Summarization on long documents](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsummarization-on-long-documents%2F920%2F2)%3A
>
> You can try extractive summarisation followed by abstractive. In the extractive step you choose top k sentences of which you choose top n allowed till model max length. Another way is to use successive abstractive summarisation where you summarise in chunk of model max length and then again use it to summarise till the length you want. This method will be super expensive. You can also combine first + second method.

---

<div class="post-metadata">

**Author:** ![thiagocmoreira](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@thiagocmoreira](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fthiagocmoreira)%5C
**Post date:** [September 27, 2020, 3:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266%2F4 "2020-09-27T15:17:30Z")

</div>

Do you have any idea how I can do this extractive summarization before? I would have to cut my text in half to be the ideal size, but I don’t know how to get the most relevant sentences in this extractive step.

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvalhalla)%5C
**Post date:** [September 28, 2020, 6:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-i-fine-tune-bart-for-summarization-using-large-texts%2F1266%2F5 "2020-09-28T06:15:41Z")

</div>

could you post this question in that thread, people there might have tried this, let’s keep the long summ discussion in one thread 🙂
