johnnyfivefingers commited on
Commit
7312d2a
1 Parent(s): 2dc9e73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -20,6 +20,7 @@ def summarize(text):
20
  return str(lines)
21
 
22
 
 
23
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
24
  generated_summary_long = summarizer(text, max_length=200, min_length=40)[0]['summary_text']
25
 
@@ -28,7 +29,7 @@ def summarize(text):
28
  writer = csv.writer(f)
29
  writer.writerow(fields)
30
 
31
- return "Summary: " + str(generated_summary) + "\n" + "Longer: " + str(generated_summary_long)
32
 
33
  iface = gr.Interface(fn=summarize, inputs="text", outputs="text")
34
  iface.launch()
 
20
  return str(lines)
21
 
22
 
23
+ generated_summary_short = summarizer(text, max_length=40, min_length=10)[0]['summary_text']
24
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
25
  generated_summary_long = summarizer(text, max_length=200, min_length=40)[0]['summary_text']
26
 
 
29
  writer = csv.writer(f)
30
  writer.writerow(fields)
31
 
32
+ return "Summary: " + str(generated_summary) + "\n\n" + "shorter: " + str(generated_summary_short)+ "\n\n" + "Longer: " + str(generated_summary_long)
33
 
34
  iface = gr.Interface(fn=summarize, inputs="text", outputs="text")
35
  iface.launch()