DrishtiSharma commited on
Commit
9cd8f90
Β·
verified Β·
1 Parent(s): 0e73945

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -180,13 +180,18 @@ if query:
180
  retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 3})
181
  contexts = retriever.invoke(query)
182
  # Debugging: Check what was retrieved
183
- st.write("Retrieved Contexts:", contexts)
184
- st.write("Number of Contexts:", len(contexts))
185
 
186
  context = [d.page_content for d in contexts]
187
  # Debugging: Check extracted context
188
- st.write("Extracted Context (page_content):", context)
189
- st.write("Number of Extracted Contexts:", len(context))
 
 
 
 
 
190
 
191
  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.
192
  Analyze the provided QUERY AND CONTEXT to determine if each Ccontent in the CONTEXT LIST contains Relevant information to answer the QUERY.
 
180
  retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 3})
181
  contexts = retriever.invoke(query)
182
  # Debugging: Check what was retrieved
183
+ #st.write("Retrieved Contexts:", contexts)
184
+ #st.write("Number of Contexts:", len(contexts)
185
 
186
  context = [d.page_content for d in contexts]
187
  # Debugging: Check extracted context
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.
197
  Analyze the provided QUERY AND CONTEXT to determine if each Ccontent in the CONTEXT LIST contains Relevant information to answer the QUERY.