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