anmolsahai commited on
Commit
e2bb6ed
1 Parent(s): 34d5264
__pycache__/langchain_pipeline.cpython-310.pyc ADDED
Binary file (263 kB). View file
 
app.py CHANGED
@@ -8,20 +8,50 @@ model_name = st.selectbox(
8
  "Model",
9
  model_names())
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  uploaded_file = st.file_uploader("Choose a file")
12
  if uploaded_file is not None:
13
- # To read file as bytes:
14
-
15
  diff = ""
16
  with st.spinner('Please wait ...'):
17
  try:
18
- diff = pipeline(uploaded_file, model_name)
 
 
 
 
 
 
 
 
19
  except Exception as e:
20
  st.exception(e)
21
 
22
  diff_lines = diff.split("\n")
23
 
24
- # Use HTML and CSS to style the diff lines
25
  styled_diff = """
26
  <style>
27
  body {
@@ -50,7 +80,6 @@ if uploaded_file is not None:
50
  styled_diff += f'<div class="diff">{line}</div>'
51
  styled_diff += "</div>"
52
 
53
- # Display styled diff
54
  st.markdown(styled_diff, unsafe_allow_html=True)
55
 
56
  st.markdown("The key changes are:")
 
8
  "Model",
9
  model_names())
10
 
11
+ balance_type = st.selectbox(
12
+ "Do you charge on available balance or ledger balance?",
13
+ ["available balance", "ledger balance"]
14
+ )
15
+
16
+ apsn_transactions = st.selectbox(
17
+ "Do you charge for APSN transactions?",
18
+ ["yes", "no"]
19
+ )
20
+
21
+ max_fees_per_day = st.number_input(
22
+ "How many overdraft fees per day can be charged?",
23
+ min_value=0, max_value=10, value=3
24
+ )
25
+
26
+ min_overdrawn_fee = st.number_input(
27
+ "What is the minimum amount overdrawn to incur a fee?",
28
+ min_value=0, value=50
29
+ )
30
+
31
+ min_transaction_overdraft = st.number_input(
32
+ "What is the minimum transaction amount to trigger an overdraft?",
33
+ min_value=0, value=25
34
+ )
35
+
36
  uploaded_file = st.file_uploader("Choose a file")
37
  if uploaded_file is not None:
 
 
38
  diff = ""
39
  with st.spinner('Please wait ...'):
40
  try:
41
+ diff = pipeline(
42
+ uploaded_file,
43
+ model_name,
44
+ balance_type,
45
+ apsn_transactions,
46
+ max_fees_per_day,
47
+ min_overdrawn_fee,
48
+ min_transaction_overdraft
49
+ )
50
  except Exception as e:
51
  st.exception(e)
52
 
53
  diff_lines = diff.split("\n")
54
 
 
55
  styled_diff = """
56
  <style>
57
  body {
 
80
  styled_diff += f'<div class="diff">{line}</div>'
81
  styled_diff += "</div>"
82
 
 
83
  st.markdown(styled_diff, unsafe_allow_html=True)
84
 
85
  st.markdown("The key changes are:")
langchain_pipeline.py CHANGED
@@ -1068,23 +1068,31 @@ IV. CONCLUSION
1068
  For the foregoing reasons, we reverse the district court's order granting LGE's motion to dismiss and remand for further proceedings consistent with this opinion.
1069
  REVERSED AND REMANDED.
1070
  13
 
1071
 
1072
- end of law context
1073
- =====
1074
- disclosure:
1075
-
1076
- {disclosure}
1077
-
1078
- end of disclosure
1079
- ===
1080
- Given the context above, how would a good regulatory attorney edit the disclosure above? Ignore the model form a-9 and focus only on laws.
1081
- Please provide only changes to the text in git diff format if they contradict any laws or rules, do not provide enough clarity based on the spirit of the law, or give you pause.
1082
- If there is a company name or general information about the bank, there is no need to correct that sentence unless there is a legal contradiction.
1083
- In your response, provide the git diff and, underneath it, all of the reasons for the changes referencing the law.
1084
- Be as thorough as possible.
1085
- """,
 
 
 
 
 
 
 
 
1086
  )
1087
- val = prompt.format(context=related_docs, disclosure={disclosure_text})
1088
 
1089
  chat_response = models[model_name].invoke(input=val)
1090
 
 
1068
  For the foregoing reasons, we reverse the district court's order granting LGE's motion to dismiss and remand for further proceedings consistent with this opinion.
1069
  REVERSED AND REMANDED.
1070
  13
1071
+ --------
1072
 
1073
+ above are several cases and a bank disclosure. Using the cases, please provide changes to the disclosure and keep as much formatting as possible and to ensure there are no legal contradictions between the content of the disclosure and the cases and please provide reasoning for each proposed change. Please also integrate the bank's policies into the disclosure. In the first sentence, please include a reference to the account agreement "for more information on overdrafts" and a placeholder for a URL.
1074
+ Here are the answers to the bank's policy questions:
1075
+ Do you charge on available balance or ledger balance?: {balance_type}
1076
+ Do you charge for APSN transactions?: {apsn_transactions}
1077
+ How many overdraft fees per day can be charged?: {max_fees_per_day}
1078
+ What is the minimum amount overdrawn to incur a fee?: {min_overdrawn_fee}
1079
+ What is the minimum transaction amount to trigger an overdraft?: {min_transaction_overdraft}
1080
+
1081
+ Please output in the following format:
1082
+ {entire updated disclosure text with changes **bolded**}
1083
+ ------
1084
+ {reasons for each change listed and cases cited}
1085
+ """
1086
+ )
1087
+ val = prompt.format(
1088
+ context=related_docs,
1089
+ disclosure=disclosure_text,
1090
+ balance_type=balance_type,
1091
+ apsn_transactions=apsn_transactions,
1092
+ max_fees_per_day=max_fees_per_day,
1093
+ min_overdrawn_fee=min_overdrawn_fee,
1094
+ min_transaction_overdraft=min_transaction_overdraft,
1095
  )
 
1096
 
1097
  chat_response = models[model_name].invoke(input=val)
1098