Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,10 @@ def predict_pptx_content(file_path):
|
|
21 |
print(f"File path received: {file_path}")
|
22 |
try:
|
23 |
extracted_text = extract_text_from_pptx(file_path)
|
|
|
|
|
24 |
cleaned_text = re.sub(r'\s+', ' ', extracted_text)
|
|
|
25 |
|
26 |
classifier = pipeline("text-classification", model="Ahmed235/roberta_classification")
|
27 |
# summarizer = pipeline("summarization", model="Falconsai/text_summarization")
|
@@ -38,9 +41,9 @@ def predict_pptx_content(file_path):
|
|
38 |
|
39 |
return prediction
|
40 |
except Exception as e:
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
|
45 |
# Define the Gradio interface
|
46 |
iface = gr.Interface(
|
|
|
21 |
print(f"File path received: {file_path}")
|
22 |
try:
|
23 |
extracted_text = extract_text_from_pptx(file_path)
|
24 |
+
print(f"Extracted text: {extracted_text}")
|
25 |
+
|
26 |
cleaned_text = re.sub(r'\s+', ' ', extracted_text)
|
27 |
+
print(f"Cleaned text: {cleaned_text}")
|
28 |
|
29 |
classifier = pipeline("text-classification", model="Ahmed235/roberta_classification")
|
30 |
# summarizer = pipeline("summarization", model="Falconsai/text_summarization")
|
|
|
41 |
|
42 |
return prediction
|
43 |
except Exception as e:
|
44 |
+
print(f"Error processing file: {e}")
|
45 |
+
return {"error": str(e)}
|
46 |
+
|
47 |
|
48 |
# Define the Gradio interface
|
49 |
iface = gr.Interface(
|