Update app.py
Browse files
app.py
CHANGED
|
@@ -34,12 +34,10 @@ def predict_pptx_content(file_path):
|
|
| 34 |
predicted_label = result[0]['label']
|
| 35 |
predicted_probability = result[0]['score']
|
| 36 |
summary = summarizer(extracted_text, max_length=80, min_length=30, do_sample=False)[0]['summary_text']
|
| 37 |
-
|
| 38 |
-
# Return a dictionary with keys corresponding to Gradio output components
|
| 39 |
prediction = {
|
| 40 |
"text": f"Predicted Label: {predicted_label}",
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
}
|
| 44 |
|
| 45 |
return prediction
|
|
@@ -53,7 +51,7 @@ def predict_pptx_content(file_path):
|
|
| 53 |
iface = gr.Interface(
|
| 54 |
fn=predict_pptx_content,
|
| 55 |
inputs=gr.File(type="filepath", label="Upload PowerPoint (.pptx) file"),
|
| 56 |
-
outputs=["text", "
|
| 57 |
live=False,
|
| 58 |
title="<h1 style='color: lightgreen; text-align: center;'>HackTalk Analyzer</h1>",
|
| 59 |
)
|
|
|
|
| 34 |
predicted_label = result[0]['label']
|
| 35 |
predicted_probability = result[0]['score']
|
| 36 |
summary = summarizer(extracted_text, max_length=80, min_length=30, do_sample=False)[0]['summary_text']
|
|
|
|
|
|
|
| 37 |
prediction = {
|
| 38 |
"text": f"Predicted Label: {predicted_label}",
|
| 39 |
+
"text": f"Evaluation: Evaluate the topic according to {predicted_label} is: {predicted_probability}",
|
| 40 |
+
"text": f"Summary: {summary}",
|
| 41 |
}
|
| 42 |
|
| 43 |
return prediction
|
|
|
|
| 51 |
iface = gr.Interface(
|
| 52 |
fn=predict_pptx_content,
|
| 53 |
inputs=gr.File(type="filepath", label="Upload PowerPoint (.pptx) file"),
|
| 54 |
+
outputs=["text", "text", "text"], # Use "text" for all components
|
| 55 |
live=False,
|
| 56 |
title="<h1 style='color: lightgreen; text-align: center;'>HackTalk Analyzer</h1>",
|
| 57 |
)
|