Spaces:
Runtime error
Runtime error
itsmariamaraki
commited on
Commit
β’
1769f1b
1
Parent(s):
90e55eb
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def abstract(pdf_file):
|
|
35 |
|
36 |
|
37 |
|
38 |
-
summarization = pipeline('summarization', model = '
|
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('.'
|
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)
|