itsmariamaraki commited on
Commit
1769f1b
β€’
1 Parent(s): 90e55eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def abstract(pdf_file):
35
 
36
 
37
 
38
- summarization = pipeline('summarization', model = 'pszemraj/long-t5-tglobal-base-16384-book-summary') #best summarization model i tested regarding this assessment
39
  audiospeech = pipeline('text-to-speech', model = 'suno/bark-small') #the voice is a bit distorted but gives a good output & takes less time
40
 
41
 
@@ -45,7 +45,7 @@ def summarization_n_audiospeech(pdf_file):
45
 
46
  summary = summarization(abstract_text, max_length=50, min_length=10)[0]['summary_text'] #didn't know exactly what would give one sentence, so i checked multiple times the min & max lengths regarding the 11th article. for a dif article, those parameters would probably have to be different as well
47
 
48
- fin_summary = summary.split('.', 1)[0] + '.' #extract and print only the first sentence of the summary
49
 
50
  #converting the summarization into an audio output
51
  tts_output = audiospeech(fin_summary)
 
35
 
36
 
37
 
38
+ summarization = pipeline('summarization', model = 'facebook/bart-large-cnn') #best summarization model i tested regarding this assessment
39
  audiospeech = pipeline('text-to-speech', model = 'suno/bark-small') #the voice is a bit distorted but gives a good output & takes less time
40
 
41
 
 
45
 
46
  summary = summarization(abstract_text, max_length=50, min_length=10)[0]['summary_text'] #didn't know exactly what would give one sentence, so i checked multiple times the min & max lengths regarding the 11th article. for a dif article, those parameters would probably have to be different as well
47
 
48
+ fin_summary = summary.split('.')[0] + '.' #extract and print only the first sentence of the summary
49
 
50
  #converting the summarization into an audio output
51
  tts_output = audiospeech(fin_summary)