Update app.py
Browse files
app.py
CHANGED
@@ -34,13 +34,24 @@ 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 |
-
"
|
39 |
-
"
|
40 |
-
"
|
41 |
}
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
except Exception as e:
|
46 |
# Log the error details
|
@@ -51,7 +62,7 @@ def predict_pptx_content(file_path):
|
|
51 |
iface = gr.Interface(
|
52 |
fn=predict_pptx_content,
|
53 |
inputs=gr.File(type="filepath", label="Upload PowerPoint (.pptx) file"),
|
54 |
-
outputs=["text",
|
55 |
live=False,
|
56 |
title="<h1 style='color: lightgreen; text-align: center;'>HackTalk Analyzer</h1>",
|
57 |
)
|
|
|
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_1 = {
|
38 |
+
"Predicted_Label": f"{predicted_label}\n",
|
39 |
+
"Evaluation": f"Evaluate the topic according to {predicted_label} is: {predicted_probability}\n",
|
40 |
+
"Summary": summary,
|
41 |
}
|
42 |
|
43 |
+
prediction_2 = {
|
44 |
+
"Predicted_Label": f"{predicted_label}\n",
|
45 |
+
"Evaluation": f"Evaluate the topic according to {predicted_label} is: {predicted_probability}\n",
|
46 |
+
"Summary": summary,
|
47 |
+
}
|
48 |
+
prediction_3= {
|
49 |
+
"Predicted_Label": f"{predicted_label}\n",
|
50 |
+
"Evaluation": f"Evaluate the topic according to {predicted_label} is: {predicted_probability}\n",
|
51 |
+
"Summary": summary,
|
52 |
+
}
|
53 |
+
|
54 |
+
return prediction_1,prediction_2,prediction_3
|
55 |
|
56 |
except Exception as e:
|
57 |
# Log the error details
|
|
|
62 |
iface = gr.Interface(
|
63 |
fn=predict_pptx_content,
|
64 |
inputs=gr.File(type="filepath", label="Upload PowerPoint (.pptx) file"),
|
65 |
+
outputs=["text","text","text"],
|
66 |
live=False,
|
67 |
title="<h1 style='color: lightgreen; text-align: center;'>HackTalk Analyzer</h1>",
|
68 |
)
|