ArturG9 commited on
Commit
6e8547a
1 Parent(s): 886eded

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -93,7 +93,8 @@ def main():
93
  page_icon=":books:")
94
  st.write(css, unsafe_allow_html=True)
95
 
96
-
 
97
 
98
  st.markdown("Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations... ")
99
 
@@ -174,9 +175,7 @@ def create_conversational_rag_chain(retriever):
174
  verbose=False,
175
  )
176
 
177
- template = """**Given the context (format: dictionary) and question, provide a comprehensive answer in natural language that addresses the question directly.
178
-
179
- **Indicate the confidence level in the answer based on how well it aligns with the information in the context (high, medium, low).**
180
 
181
  The context contains documents with a 'page_content' field and potentially other metadata. Focus on the 'page_content' field for information retrieval.
182
 
@@ -186,10 +185,7 @@ When answering, prioritize including all relevant details from the context to su
186
 
187
  **Question:** {question}
188
  **Context:** {context}
189
- **Answer:** (answer)
190
-
191
- **Confidence Level:** (high/medium/low) - Briefly explain why this confidence level is assigned based on the context.
192
- For example: "High confidence - The answer is directly supported by Article 32 of the LR_Constitution_2022.")
193
  """
194
  prompt = ChatPromptTemplate.from_template(template, role='ai')
195
 
 
93
  page_icon=":books:")
94
  st.write(css, unsafe_allow_html=True)
95
 
96
+ st.header("Chat with multiple Lithuanian Law Documents: ",
97
+ page_icon=":books:")
98
 
99
  st.markdown("Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations... ")
100
 
 
175
  verbose=False,
176
  )
177
 
178
+ template = """**Given the context (format: dictionary) and question, provide a comprehensive answer in natural language that addresses the question directly.**
 
 
179
 
180
  The context contains documents with a 'page_content' field and potentially other metadata. Focus on the 'page_content' field for information retrieval.
181
 
 
185
 
186
  **Question:** {question}
187
  **Context:** {context}
188
+ Answer:
 
 
 
189
  """
190
  prompt = ChatPromptTemplate.from_template(template, role='ai')
191