Spaces:
Runtime error
Runtime error
Alex Strick van Linschoten
commited on
Commit
•
8b969e2
1
Parent(s):
024685f
fix zero division error
Browse files
app.py
CHANGED
@@ -164,9 +164,9 @@ def predict(pdf, confidence, generate_file):
|
|
164 |
|
165 |
text_output = f"A total of {len(redacted_pages)} pages were redacted. \n\n The redacted page numbers were: {', '.join(redacted_pages)}. "
|
166 |
|
167 |
-
redaction_analysis = f"{total_redaction_proportion}% of the total area of the redacted pages was redacted. \n {content_redaction_proportion}% of the actual content of those redacted pages was redacted."
|
168 |
-
|
169 |
if generate_file:
|
|
|
|
|
170 |
return text_output + redaction_analysis, images, report
|
171 |
else:
|
172 |
return text_output, images, None
|
|
|
164 |
|
165 |
text_output = f"A total of {len(redacted_pages)} pages were redacted. \n\n The redacted page numbers were: {', '.join(redacted_pages)}. "
|
166 |
|
|
|
|
|
167 |
if generate_file:
|
168 |
+
redaction_analysis = f"{total_redaction_proportion}% of the total area of the redacted pages was redacted. \n {content_redaction_proportion}% of the actual content of those redacted pages was redacted."
|
169 |
+
|
170 |
return text_output + redaction_analysis, images, report
|
171 |
else:
|
172 |
return text_output, images, None
|