Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
|
@@ -152,11 +152,13 @@ def extract_abstract(text_per_pagy):
|
|
| 152 |
|
| 153 |
|
| 154 |
|
|
|
|
|
|
|
| 155 |
def main_function(pdf_file):
|
| 156 |
# Converti il PDF in testo
|
| 157 |
text_per_pagy = read_pdf(pdf_file.name)
|
| 158 |
|
| 159 |
-
# Pulisci e estrai l'abstract
|
| 160 |
for key, value in text_per_pagy.items():
|
| 161 |
cleaned_text = clean_text(' '.join(value[0]))
|
| 162 |
text_per_pagy[key] = cleaned_text
|
|
@@ -179,7 +181,7 @@ def main_function(pdf_file):
|
|
| 179 |
# Restituisci testo e audio
|
| 180 |
return summary, audio_file_path
|
| 181 |
|
| 182 |
-
|
| 183 |
iface = gr.Interface(
|
| 184 |
fn=main_function,
|
| 185 |
inputs=gr.inputs.File(type="pdf"),
|
|
|
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
+
# Importazioni e definizioni delle funzioni come prima...
|
| 156 |
+
|
| 157 |
def main_function(pdf_file):
|
| 158 |
# Converti il PDF in testo
|
| 159 |
text_per_pagy = read_pdf(pdf_file.name)
|
| 160 |
|
| 161 |
+
# Pulisci il testo e estrai l'abstract
|
| 162 |
for key, value in text_per_pagy.items():
|
| 163 |
cleaned_text = clean_text(' '.join(value[0]))
|
| 164 |
text_per_pagy[key] = cleaned_text
|
|
|
|
| 181 |
# Restituisci testo e audio
|
| 182 |
return summary, audio_file_path
|
| 183 |
|
| 184 |
+
|
| 185 |
iface = gr.Interface(
|
| 186 |
fn=main_function,
|
| 187 |
inputs=gr.inputs.File(type="pdf"),
|