DeepVen commited on
Commit
d20ef6e
·
1 Parent(s): af5aac8

Update LLMInsights.py

Browse files
Files changed (1) hide show
  1. LLMInsights.py +12 -6
LLMInsights.py CHANGED
@@ -396,13 +396,19 @@ with tab1:
396
  )
397
  else:
398
  score = "Evaluation is Turned OFF"
399
- st.markdown('<h1 style="color:#100170;font-size:24px;">Confidence Score</h1>', unsafe_allow_html=True)
400
- st.text_area(label="", value=score, height=30)
401
- st.markdown('<h1 style="color:#100170;font-size:24px;">Hallucinated?</h1>', unsafe_allow_html=True)
402
- st.text_area(label="", value=hallucination_score, height=30)
 
 
 
 
 
403
  cleaned_context = "\n".join(line.strip() for line in context.splitlines() if line.strip())
404
- st.markdown('<h1 style="color:#100170;font-size:24px;">Context</h1>', unsafe_allow_html=True)
405
- st.text_area(label="", value=cleaned_context)
 
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 = []