Update LLMInsights.py
Browse files- LLMInsights.py +12 -6
LLMInsights.py
CHANGED
@@ -396,13 +396,19 @@ with tab1:
|
|
396 |
)
|
397 |
else:
|
398 |
score = "Evaluation is Turned OFF"
|
399 |
-
|
400 |
-
st.
|
401 |
-
st.markdown('<
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
403 |
cleaned_context = "\n".join(line.strip() for line in context.splitlines() if line.strip())
|
404 |
-
st.markdown('<
|
405 |
-
st.
|
|
|
406 |
|
407 |
metadata_list = [doc.metadata for doc in response["source_documents"]]
|
408 |
formatted_metadata_list = []
|
|
|
396 |
)
|
397 |
else:
|
398 |
score = "Evaluation is Turned OFF"
|
399 |
+
# Confidence Score Section
|
400 |
+
st.markdown('<h2 style="color:#100170;">Confidence Score</h2>', unsafe_allow_html=True)
|
401 |
+
st.markdown(f'<div style="max-height: 150px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{score}</div>', unsafe_allow_html=True)
|
402 |
+
|
403 |
+
# Hallucinated Section
|
404 |
+
st.markdown('<h2 style="color:#100170;">Hallucinated?</h2>', unsafe_allow_html=True)
|
405 |
+
st.markdown(f'<div style="max-height: 150px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{hallucination_score}</div>', unsafe_allow_html=True)
|
406 |
+
|
407 |
+
# Clean and Scrollable Context Section
|
408 |
cleaned_context = "\n".join(line.strip() for line in context.splitlines() if line.strip())
|
409 |
+
st.markdown('<h2 style="color:#100170;">Context</h2>', unsafe_allow_html=True)
|
410 |
+
st.markdown(f'<div style="max-height: 300px; overflow-y: auto; background-color:#f0f0f0; padding:10px; border-radius:10px;">{cleaned_context}</div>', unsafe_allow_html=True)
|
411 |
+
|
412 |
|
413 |
metadata_list = [doc.metadata for doc in response["source_documents"]]
|
414 |
formatted_metadata_list = []
|