min_length parameter in default pipeline summarization produces output smaller than min_length
Author: Weilin37
Pull request: no

Hi, I am using pipeline summarization. My code is below:

```
from transformers import pipeline, AutoTokenizer, AutoModel

summarizer = pipeline("summarization")
abstract_dictionary = {'Introduction':'','Methods':'','Results':'','Discussion':''}

for section in article_dictionary:
    if section == 'Introduction':
        min_length = 100
    elif section == 'Methods':
        min_length = 200
    elif section == 'Results':
        min_length = 250
    elif section == 'Discussion':
        min_length = 100
    
    summary = summarizer(article_dictionary[section], min_length=min_length)[0]['summary_text']
    abstract_dictionary[section] = abstract_dictionary[section]+' '+summary

for section in abstract_dictionary:
    print(section)
    print(abstract_dictionary[section])
    print(" ")
```

and I get the following summary. You will notice that each section is smaller than the min length specified. 

Introduction
 Renal-cell carcinoma is characterized by susceptibility to both immunotherapeutic and antiangiogenic treatment approaches and resistance to cytotoxic chemotherapy. Agents such as sunitinib that target the vascular endothelial growth factor (VEGF) pathway are standard first-line therapy for advanced disease. We conducted the KEYNOTE-426 trial to determine whether pembrolizumab plus axit inib would result in better outcomes than sunit in patients with previously untreated advanced renal- cell carcinoma.
 
Methods
 Pembrolizumab (Keytruda, Merck Sharp & Dohme) plus axitinib (Inlyta, Pfizer) or sunitinIB (Sutent, Pfizers) was used in an open-label, phase 3 trial. Eligible patients were 18 years of age or older; had newly diagnosed or recurrent stage IV clear-cell renal-cell carcinoma; had received no previous systemic therapy for advanced disease; and had a Karnofsky performance-status score of 70 or more. Patients were excluded if they had symptomatic central nervous system metastases, active autoimmune disease, or poorly controlled hypertension. Data on adverse events were collected regularly,
 
Results
 A total of 1062 patients at 129 sites in 16 countries were screened for eligibility. Of these, 861 patients at 124 sites underwent randomization from October 24, 2016, to January 24, 2018. A total of 432 patients were assigned to the pembrolizumab–axitinib group, and 429 patients to the sunit inib group. The median duration of any treatment was 10.4 months in both groups. The estimated percentage of patients who were alive at 12 months was 89.9% (95% CI, 86.4 to 92.4) in the pembrozumab group and 78.3% (75.8 to 82.,
 
Discussion
 Treatment with pembrolizumab plus axitinib resulted in a 47% lower risk of death. The objective response rate was 23.6 percentage points higher in the pembrozumab–axit inib group than in the sunitin ib group. The benefit of pembrology plus ax itinib was observed across all subgroups tested. No deaths related to hepatic adverse events were reported in this trial. However, the overall frequency of toxic effects was similar in the two groups.

Comments:
Hi @Weilin37,

How did you count the length of your output? The `min_length` corresponds to the minimum number of tokens in the output which is `<=` number of words.
To count the number of tokens you have in your output text, you could use `tokenizer.tokenize(OUTPUT_TEXT)`

> Hi @Weilin37,
> 
> How did you count the length of your output? The `min_length` corresponds to the minimum number of tokens in the output which is `<=` number of words.
> To count the number of tokens you have in your output text, you could use `tokenizer.tokenize(OUTPUT_TEXT)`

Hi. Ah ok thanks for clarifying. I had mistakenly thought it was the # of words.

Hi @patrickvonplaten,

Is it possible to set the minimum number of words instead of tokens?