Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,12 +68,14 @@ def fetch_and_display_content(url):
|
|
| 68 |
cleaned_text, # β
Extracted content
|
| 69 |
metadata, # β
Article metadata
|
| 70 |
detected_lang, # β
Detected language
|
| 71 |
-
gr.update(visible=True), # β
|
| 72 |
-
gr.update(visible=True), # β
|
| 73 |
-
gr.update(visible=True), # β
|
| 74 |
-
gr.update(visible=True), # β
|
| 75 |
"", # β
Reset Summary output when a new URL is fetched
|
| 76 |
-
""
|
|
|
|
|
|
|
| 77 |
)
|
| 78 |
|
| 79 |
### 2οΈβ£ Cleaning Function
|
|
@@ -292,7 +294,12 @@ with gr.Blocks() as demo:
|
|
| 292 |
fetch_and_display_content,
|
| 293 |
inputs=[url_input],
|
| 294 |
|
| 295 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
)
|
| 297 |
|
| 298 |
process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])
|
|
|
|
| 68 |
cleaned_text, # β
Extracted content
|
| 69 |
metadata, # β
Article metadata
|
| 70 |
detected_lang, # β
Detected language
|
| 71 |
+
gr.update(visible=True), # β
Show Summary button
|
| 72 |
+
gr.update(visible=True), # β
Show Audio button
|
| 73 |
+
gr.update(visible=True), # β
Show Extracted text box
|
| 74 |
+
gr.update(visible=True), # β
Show Metadata box
|
| 75 |
"", # β
Reset Summary output when a new URL is fetched
|
| 76 |
+
"", # β
Reset Entity output when a new URL is fetched
|
| 77 |
+
gr.update(value=cleaned_text, visible=True), # β
Ensure Extracted Text is shown
|
| 78 |
+
gr.update(value=metadata, visible=True) # β
Ensure Metadata is shown
|
| 79 |
)
|
| 80 |
|
| 81 |
### 2οΈβ£ Cleaning Function
|
|
|
|
| 294 |
fetch_and_display_content,
|
| 295 |
inputs=[url_input],
|
| 296 |
|
| 297 |
+
outputs=[
|
| 298 |
+
extracted_text, metadata_output, detected_lang,
|
| 299 |
+
process_summary_button, process_audio_button,
|
| 300 |
+
summary_output, ner_output,
|
| 301 |
+
extracted_text, metadata_output # β
Ensures visibility update
|
| 302 |
+
]
|
| 303 |
)
|
| 304 |
|
| 305 |
process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])
|