Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
from pptx import Presentation
|
4 |
import re
|
|
|
5 |
|
6 |
# Create a text classification pipeline
|
7 |
classifier = pipeline("text-classification", model="Ahmed235/roberta_classification", tokenizer="Ahmed235/roberta_classification")
|
@@ -35,7 +36,7 @@ def predict_pptx_content(file_path):
|
|
35 |
predicted_probability = result[0]['score']
|
36 |
summary = summarizer(extracted_text, max_length=1000, min_length=30, do_sample=False)[0]['summary_text']
|
37 |
|
38 |
-
|
39 |
"predicted_label": predicted_label,
|
40 |
"evaluation": predicted_probability,
|
41 |
"summary": summary
|
|
|
2 |
from transformers import pipeline
|
3 |
from pptx import Presentation
|
4 |
import re
|
5 |
+
import json
|
6 |
|
7 |
# Create a text classification pipeline
|
8 |
classifier = pipeline("text-classification", model="Ahmed235/roberta_classification", tokenizer="Ahmed235/roberta_classification")
|
|
|
36 |
predicted_probability = result[0]['score']
|
37 |
summary = summarizer(extracted_text, max_length=1000, min_length=30, do_sample=False)[0]['summary_text']
|
38 |
|
39 |
+
output_dict = {
|
40 |
"predicted_label": predicted_label,
|
41 |
"evaluation": predicted_probability,
|
42 |
"summary": summary
|