Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,8 +61,7 @@ def fetch_and_display_content(url):
|
|
61 |
|
62 |
# Add detected language to metadata
|
63 |
metadata["Detected Language"] = detected_lang.upper()
|
64 |
-
|
65 |
-
#return cleaned_text, metadata, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
66 |
return cleaned_text, metadata, detected_lang, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
67 |
|
68 |
### 2οΈβ£ Cleaning Function
|
@@ -167,7 +166,7 @@ def extract_entities_with_stanza(text, chunk_size=1000):
|
|
167 |
for chunk in chunks:
|
168 |
doc = nlp(chunk)
|
169 |
for ent in doc.ents:
|
170 |
-
|
171 |
entities.append(f"π **Entity**: \"{ent.text}\" | **Type**: {ent.type}") # β
Format output
|
172 |
|
173 |
#return entities
|
@@ -281,7 +280,7 @@ with gr.Blocks() as demo:
|
|
281 |
fetch_and_display_content,
|
282 |
inputs=[url_input],
|
283 |
|
284 |
-
outputs=[extracted_text, metadata_output, detected_lang, process_summary_button, process_audio_button, summary_output, ner_output]
|
285 |
)
|
286 |
|
287 |
process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])
|
|
|
61 |
|
62 |
# Add detected language to metadata
|
63 |
metadata["Detected Language"] = detected_lang.upper()
|
64 |
+
|
|
|
65 |
return cleaned_text, metadata, detected_lang, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
66 |
|
67 |
### 2οΈβ£ Cleaning Function
|
|
|
166 |
for chunk in chunks:
|
167 |
doc = nlp(chunk)
|
168 |
for ent in doc.ents:
|
169 |
+
|
170 |
entities.append(f"π **Entity**: \"{ent.text}\" | **Type**: {ent.type}") # β
Format output
|
171 |
|
172 |
#return entities
|
|
|
280 |
fetch_and_display_content,
|
281 |
inputs=[url_input],
|
282 |
|
283 |
+
outputs=[extracted_text, metadata_output, detected_lang, process_summary_button, process_audio_button, summary_output, ner_output, extracted_text, metadata_output]
|
284 |
)
|
285 |
|
286 |
process_summary_button.click(hierarchical_summarization, inputs=[extracted_text], outputs=[summary_output])
|