Improve confidence score display with inline-flex and whitespace handling
Browse files- Add `inline-flex` and `whitespace-nowrap` classes to confidence score divs
- Ensure consistent text alignment and prevent text wrapping
- Maintain existing color and styling for result tiles
app.py
CHANGED
@@ -263,8 +263,8 @@ def generate_results_html(results):
|
|
263 |
<div>
|
264 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
265 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
266 |
-
<div class="bg-green-400 h-full rounded-none" style="width: {results[0][2] * 100:.2f}%;">
|
267 |
-
<p class="
|
268 |
<span class="ml-1 font-medium font-mono">{results[0][2]:.4f}</span>
|
269 |
</p>
|
270 |
</div>
|
@@ -272,7 +272,7 @@ def generate_results_html(results):
|
|
272 |
</div>
|
273 |
<div class="relative -mx-4 bg-gray-800">
|
274 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
275 |
-
<div class="inline-flex bg-red-400 h-full rounded-none" style="width: {results[0][3] * 100:.2f}%;">
|
276 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
277 |
<span class="ml-1 font-medium font-mono">{results[0][3]:.4f}</span>
|
278 |
</p>
|
@@ -306,7 +306,7 @@ def generate_results_html(results):
|
|
306 |
<div>
|
307 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
308 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
309 |
-
<div class="bg-green-400 h-full rounded-none" style="width: {results[1][2] * 100:.2f}%;">
|
310 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
311 |
<span class="ml-1 font-medium font-mono">{results[1][2]:.4f}</span>
|
312 |
</p>
|
@@ -315,7 +315,7 @@ def generate_results_html(results):
|
|
315 |
</div>
|
316 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
317 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
318 |
-
<div class="inline-flex bg-red-400 h-full rounded-none" style="width: {results[1][3] * 100:.2f}%;">
|
319 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
320 |
<span class="ml-1 font-medium font-mono">{results[1][3]:.4f}</span>
|
321 |
</p>
|
@@ -349,7 +349,7 @@ def generate_results_html(results):
|
|
349 |
<div>
|
350 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
351 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
352 |
-
<div class="bg-green-400 h-full rounded-none" style="width: {results[2][2] * 100:.2f}%;">
|
353 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
354 |
<span class="ml-1 font-medium font-mono">{results[2][2]:.4f}</span>
|
355 |
</p>
|
@@ -358,7 +358,7 @@ def generate_results_html(results):
|
|
358 |
</div>
|
359 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
360 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
361 |
-
<div class="inline-flex bg-red-400 h-full rounded-none" style="width: {results[2][3] * 100:.2f}%;">
|
362 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
363 |
<span class="ml-1 font-medium font-mono">{results[2][3]:.4f}</span>
|
364 |
</p>
|
@@ -392,7 +392,7 @@ def generate_results_html(results):
|
|
392 |
<div>
|
393 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
394 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
395 |
-
<div class="bg-green-400 h-full rounded-none" style="width: {results[3][2] * 100:.2f}%;">
|
396 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
397 |
<span class="ml-1 font-medium font-mono">{results[3][2]:.4f}</span>
|
398 |
</p>
|
@@ -401,7 +401,7 @@ def generate_results_html(results):
|
|
401 |
</div>
|
402 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
403 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
404 |
-
<div class="inline-flex bg-red-400 h-full rounded-none" style="width: {results[3][3] * 100:.2f}%;">
|
405 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
406 |
<span class="ml-1 font-medium font-mono">{results[3][3]:.4f}</span>
|
407 |
</p>
|
@@ -435,7 +435,7 @@ def generate_results_html(results):
|
|
435 |
<div>
|
436 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
437 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
438 |
-
<div class="bg-green-400 h-full rounded-none" style="width: {results[4][2] * 100:.2f}%;">
|
439 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
440 |
<span class="ml-1 font-medium font-mono">{results[4][2]:.4f}</span>
|
441 |
</p>
|
@@ -444,7 +444,7 @@ def generate_results_html(results):
|
|
444 |
</div>
|
445 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
446 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
447 |
-
<div class="inline-flex bg-red-400 h-full rounded-none" style="width: {results[4][3] * 100:.2f}%;">
|
448 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
449 |
<span class="ml-1 font-medium font-mono">{results[4][3]:.4f}</span>
|
450 |
</p>
|
|
|
263 |
<div>
|
264 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
265 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
266 |
+
<div class="inline-flex whitespace-nowrap bg-green-400 h-full rounded-none" style="width: {results[0][2] * 100:.2f}%;">
|
267 |
+
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
268 |
<span class="ml-1 font-medium font-mono">{results[0][2]:.4f}</span>
|
269 |
</p>
|
270 |
</div>
|
|
|
272 |
</div>
|
273 |
<div class="relative -mx-4 bg-gray-800">
|
274 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
275 |
+
<div class="inline-flex whitespace-nowrap bg-red-400 h-full rounded-none" style="width: {results[0][3] * 100:.2f}%;">
|
276 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
277 |
<span class="ml-1 font-medium font-mono">{results[0][3]:.4f}</span>
|
278 |
</p>
|
|
|
306 |
<div>
|
307 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
308 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
309 |
+
<div class="inline-flex whitespace-nowrap bg-green-400 h-full rounded-none" style="width: {results[1][2] * 100:.2f}%;">
|
310 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
311 |
<span class="ml-1 font-medium font-mono">{results[1][2]:.4f}</span>
|
312 |
</p>
|
|
|
315 |
</div>
|
316 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
317 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
318 |
+
<div class="inline-flex whitespace-nowrap bg-red-400 h-full rounded-none" style="width: {results[1][3] * 100:.2f}%;">
|
319 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
320 |
<span class="ml-1 font-medium font-mono">{results[1][3]:.4f}</span>
|
321 |
</p>
|
|
|
349 |
<div>
|
350 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
351 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
352 |
+
<div class="inline-flex whitespace-nowrap bg-green-400 h-full rounded-none" style="width: {results[2][2] * 100:.2f}%;">
|
353 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
354 |
<span class="ml-1 font-medium font-mono">{results[2][2]:.4f}</span>
|
355 |
</p>
|
|
|
358 |
</div>
|
359 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
360 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
361 |
+
<div class="inline-flex whitespace-nowrap bg-red-400 h-full rounded-none" style="width: {results[2][3] * 100:.2f}%;">
|
362 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
363 |
<span class="ml-1 font-medium font-mono">{results[2][3]:.4f}</span>
|
364 |
</p>
|
|
|
392 |
<div>
|
393 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
394 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
395 |
+
<div class="inline-flex whitespace-nowrap bg-green-400 h-full rounded-none" style="width: {results[3][2] * 100:.2f}%;">
|
396 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
397 |
<span class="ml-1 font-medium font-mono">{results[3][2]:.4f}</span>
|
398 |
</p>
|
|
|
401 |
</div>
|
402 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
403 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
404 |
+
<div class="inline-flex whitespace-nowrap bg-red-400 h-full rounded-none" style="width: {results[3][3] * 100:.2f}%;">
|
405 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
406 |
<span class="ml-1 font-medium font-mono">{results[3][3]:.4f}</span>
|
407 |
</p>
|
|
|
435 |
<div>
|
436 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
437 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
438 |
+
<div class="inline-flex whitespace-nowrap bg-green-400 h-full rounded-none" style="width: {results[4][2] * 100:.2f}%;">
|
439 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
440 |
<span class="ml-1 font-medium font-mono">{results[4][2]:.4f}</span>
|
441 |
</p>
|
|
|
444 |
</div>
|
445 |
<div class="mt-4 relative -mx-4 bg-gray-800">
|
446 |
<div class="w-full bg-gray-400 rounded-none h-8">
|
447 |
+
<div class="inline-flex whitespace-nowrap bg-red-400 h-full rounded-none" style="width: {results[4][3] * 100:.2f}%;">
|
448 |
<p class="p-2 px-4 text-xs self-center align-middle">Conf:
|
449 |
<span class="ml-1 font-medium font-mono">{results[4][3]:.4f}</span>
|
450 |
</p>
|