Commit
·
404da8f
1
Parent(s):
154ed76
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ def calculate_distance(ocr_text, orginal_text):
|
|
7 |
org_words = orginal_text.split()
|
8 |
ocr_chars = list(ocr_text)
|
9 |
org_chars = list(orginal_text)
|
10 |
-
cer = round((Levenshtein.distance(org_chars.lower(), ocr_chars.lower()) / len(org_chars))*100,2)
|
11 |
accuracy = 100-cer
|
12 |
return f"The Character Error Rate (CER): {cer}\n The Accuracy: {accuracy}"
|
13 |
|
|
|
7 |
org_words = orginal_text.split()
|
8 |
ocr_chars = list(ocr_text)
|
9 |
org_chars = list(orginal_text)
|
10 |
+
cer = round(((Levenshtein.distance(org_chars.lower(), ocr_chars.lower()) / len(org_chars))*100),2)
|
11 |
accuracy = 100-cer
|
12 |
return f"The Character Error Rate (CER): {cer}\n The Accuracy: {accuracy}"
|
13 |
|