umaiku commited on
Commit
1eaeeb8
·
verified ·
1 Parent(s): 836fc15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -51,6 +51,7 @@ def respond(
51
  case_text = df[df["case_url"] == doc.metadata["case_url"]].case_text.values[0]
52
 
53
  context += "Case number: " + doc.metadata["case_nb"] + spacer
 
54
  context += "Case date: " + doc.metadata["case_date"] + spacer
55
  context += "Case url: " + doc.metadata["case_url"] + spacer
56
  context += "Case text: " + doc.page_content + spacer
@@ -64,7 +65,9 @@ Context:
64
  The following case extracts from various Swiss Federal Court and European Court of Human Rights cases have been found to fit the question :
65
  {context}
66
  Task:
67
- Start by summarizing these case in the user's question's language and reference the sources, including the urls and dates.
 
 
68
  Instructions:
69
  Always answer the user using the language used in his question: {message}
70
  """
 
51
  case_text = df[df["case_url"] == doc.metadata["case_url"]].case_text.values[0]
52
 
53
  context += "Case number: " + doc.metadata["case_nb"] + spacer
54
+ context += "Case source: " + ("Swiss Federal Court" if doc.metadata["case_ref"] == "ATF" else "European Court of Human Rights") + spacer
55
  context += "Case date: " + doc.metadata["case_date"] + spacer
56
  context += "Case url: " + doc.metadata["case_url"] + spacer
57
  context += "Case text: " + doc.page_content + spacer
 
65
  The following case extracts from various Swiss Federal Court and European Court of Human Rights cases have been found to fit the question :
66
  {context}
67
  Task:
68
+ Start by summarizing these cases in the user's question's language and reference the sources, including the urls and dates.
69
+ If no relevant docs were retrieved or the issue has not been addressed in the context, just say "You can't find enough relevant information".
70
+ Don't make up an answer or give irrelevant information not requested by the user .
71
  Instructions:
72
  Always answer the user using the language used in his question: {message}
73
  """