Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,20 @@ def compare_texts(reference_text, transcribed_text):
|
|
| 64 |
similarity_score = round(sm.ratio() * 100, 2)
|
| 65 |
|
| 66 |
# Construct HTML output
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
html_output += f"<strong>Quality Score:</strong> {similarity_score}<br>"
|
| 69 |
html_output += f"<strong>Transcribed Text:</strong> {transcribed_text}<br>"
|
| 70 |
html_output += "<strong>Word Score List:</strong><br>"
|
|
|
|
| 64 |
similarity_score = round(sm.ratio() * 100, 2)
|
| 65 |
|
| 66 |
# Construct HTML output
|
| 67 |
+
# html_output = f"<strong>Fidelity Class:</strong> # Tạo output HTML với các mức đánh giá chi tiết hơn
|
| 68 |
+
html_output = f"<strong>Fidelity Class:</strong> "
|
| 69 |
+
if similarity_score >= 85:
|
| 70 |
+
html_output += "GOOD (>=85%)<br>"
|
| 71 |
+
elif similarity_score >= 70:
|
| 72 |
+
html_output += "ACCEPTABLE (70% - 85%)<br>"
|
| 73 |
+
elif similarity_score >= 50:
|
| 74 |
+
html_output += "NEEDS IMPROVEMENT (50% - 70%)<br>"
|
| 75 |
+
else:
|
| 76 |
+
html_output += "POOR (<50%)<br>"
|
| 77 |
+
|
| 78 |
+
html_output += f"<strong>Quality Score:</strong> {similarity_score}%<br>"
|
| 79 |
+
html_output += f"<strong>Transcribed Text:</strong> {transcribed_text}<br>"
|
| 80 |
+
<br>"
|
| 81 |
html_output += f"<strong>Quality Score:</strong> {similarity_score}<br>"
|
| 82 |
html_output += f"<strong>Transcribed Text:</strong> {transcribed_text}<br>"
|
| 83 |
html_output += "<strong>Word Score List:</strong><br>"
|