DrishtiSharma commited on
Commit
ac6eaf3
Β·
verified Β·
1 Parent(s): 4f6da42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -36
app.py CHANGED
@@ -188,9 +188,9 @@ if query:
188
  #st.write("Extracted Context (page_content):", context)
189
  #st.write("Number of Extracted Contexts:", len(context))
190
 
191
- st.write("πŸ“„ **Relevant Passages Retrieved:**")
192
- for idx, doc in enumerate(contexts):
193
- st.write(f"**Excerpt {idx+1}:** {doc.page_content}")
194
 
195
 
196
  relevancy_prompt = """You are an expert judge tasked with evaluating whether the EACH OF THE CONTEXT provided in the CONTEXT LIST is self sufficient to answer the QUERY asked.
@@ -318,39 +318,7 @@ EXAMPLE:
318
  st.markdown("## πŸ’‘ **Final Answer**")
319
  st.success(final_output["final_response"] if final_output["final_response"] else "⚠️ No clear answer found based on retrieved content.")
320
 
321
- # πŸ“‚ Expandable Detailed Processing Section
322
- st.markdown("### πŸ“‚ **Detailed Processing Breakdown**")
323
- st.info("Expand the sections below to see retrieved contexts, relevance scores, and other details.")
324
-
325
- # πŸ“– Relevant Contexts Used
326
- with st.expander("πŸ“Œ **View Relevant Contexts Used**"):
327
- st.markdown("### πŸ“– **Relevant Contexts Extracted**")
328
- if isinstance(final_output.get("relevant_contexts"), list) and final_output["relevant_contexts"]:
329
- for idx, doc in enumerate(final_output["relevant_contexts"], 1):
330
- st.write(f"πŸ”Ή **Context {idx}:** {doc}")
331
- else:
332
- st.warning("⚠️ No relevant contexts available.")
333
-
334
- # πŸ“Š Relevance Analysis
335
- with st.expander("πŸ“Œ **View Relevance Analysis**"):
336
- st.markdown("### πŸ“Š **Context Relevancy Scores & Analysis**")
337
- if isinstance(final_output.get("relevancy_response"), list) and final_output["relevancy_response"]:
338
- for item in final_output["relevancy_response"]:
339
- st.write(f"βœ… **Context {item.get('content', 'N/A')} - Score: {item.get('score', 'N/A')}**")
340
- st.write(f"**Reasoning:** {item.get('Reasoning', 'No explanation provided.')}")
341
- else:
342
- st.warning("⚠️ No relevance analysis available.")
343
-
344
- # πŸ”’ Relevant Context Numbers
345
- with st.expander("πŸ” **View Relevant Context Numbers**"):
346
- st.markdown("### πŸ”’ **Context Numbers Used in Processing**")
347
- context_numbers = final_output.get("context_number", "⚠️ No context numbers available.")
348
-
349
- # πŸ›  Handle <think> debug output (if any)
350
- if isinstance(context_numbers, str) and "<think>" in context_numbers:
351
- context_numbers = "⚠️ No valid context numbers available."
352
-
353
- st.write(context_numbers)
354
 
355
 
356
 
 
188
  #st.write("Extracted Context (page_content):", context)
189
  #st.write("Number of Extracted Contexts:", len(context))
190
 
191
+ #st.write("πŸ“„ **Relevant Passages Retrieved:**")
192
+ #for idx, doc in enumerate(contexts):
193
+ #st.write(f"**Excerpt {idx+1}:** {doc.page_content}")
194
 
195
 
196
  relevancy_prompt = """You are an expert judge tasked with evaluating whether the EACH OF THE CONTEXT provided in the CONTEXT LIST is self sufficient to answer the QUERY asked.
 
318
  st.markdown("## πŸ’‘ **Final Answer**")
319
  st.success(final_output["final_response"] if final_output["final_response"] else "⚠️ No clear answer found based on retrieved content.")
320
 
321
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
 
323
 
324