# Truncated last sentence on summaries

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftruncated-last-sentence-on-summaries%2F1253%3E%5C
**Category:** 🤗Transformers\
**Created:** [September 24, 2020, 6:13pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftruncated-last-sentence-on-summaries%2F1253 "2020-09-24T18:13:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hf324](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@hf324](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhf324)%5C
**Post date:** [September 24, 2020, 6:13pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftruncated-last-sentence-on-summaries%2F1253%2F1 "2020-09-24T18:13:21Z")

</div>

I am running the summarization finetuning on the latest master branch version of examples/seq2seq. I am using a custom dataset. However, the last sentence on some of the resulting summaries are truncated. The issue appears to worsen as I increase my dataset size, resulting in a greater proportion of truncated summaries. My parameters are as follows:

```auto
'--data_dir=.../data',
'--train_batch_size=1',
'--eval_batch_size=1',
'--output_dir=.../output',
'--num_train_epochs=5',
'--max_target_length=1024'
'--max_source_length=56'
'--model_name_or_path=facebook/bart-large'

```

[Here is a very small data set](https://drive.google.com/drive/folders/1NIoZ1sVmCwXhAzkWFMkWpVNimr2mSgtX?usp=sharing) that I was able to reproduce the issue with (500 training instances).

Is this expected? Any insights would be helpful. Thank you!

---

<div class="post-metadata">

**Author:** ![vhartman6](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vhartman6/32/1493_2.png) [@vhartman6](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvhartman6)%5C
**Post date:** [April 11, 2021, 7:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftruncated-last-sentence-on-summaries%2F1253%2F2 "2021-04-11T19:51:58Z")

</div>

I’m experiencing this same issue with BART transformer and I created a Stackoverflow post about the issue: [https://stackoverflow.com/questions/66996270/limiting-bart-huggingface-model-to-complete-sentences-of-maximum-length](https://stackoverflow.com/questions/66996270/limiting-bart-huggingface-model-to-complete-sentences-of-maximum-length)

Here are some of the output summaries with truncated sentences:

> EX1: The opacity at the left lung base appears stable from prior exam. There is elevation of the left hemidi  
> EX 2: There is normal mineralization and alignment. No fracture or osseous lesion is identified. The ankle mort

Were you able to find a solution to this problem you encountered @hf324?

---

<div class="post-metadata">

**Author:** ![ffer](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@ffer](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fffer)%5C
**Post date:** [March 30, 2023, 3:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftruncated-last-sentence-on-summaries%2F1253%2F3 "2023-03-30T15:08:27Z")

</div>

I’m facing the same problem and still didn’t find out the solution.
