lekkalar commited on
Commit
aaf3891
1 Parent(s): 3c3def3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -42,6 +42,8 @@ def load_pdf_and_generate_embeddings(pdf_doc, open_ai_key):
42
 
43
 
44
  def answer_predefined_questions(document_type):
 
 
45
  if document_type == "Deed of Trust":
46
  #Create a list of questions around the relevant fields of a Deed of Trust(DOT) document
47
  query0 = "what is the Lender's Name?"
@@ -68,8 +70,12 @@ def answer_predefined_questions(document_type):
68
  field10 = "Property County"
69
  query11 = "what is the Electronically recorded date"
70
  field11 = "Electronic Recording Date"
71
- queryList = [query0, query1, query2, query3, query4, query5, query6, query7, query8, query9, query10, query11]
72
- fieldList = [field0, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11]
 
 
 
 
73
 
74
  elif document_type == "Transmittal Summary":
75
  #Create a list of questions around the relevant fields of a TRANSMITTAL SUMMARY document
@@ -97,8 +103,12 @@ def answer_predefined_questions(document_type):
97
  fieldA10 = "Seller"
98
  queryA11 = "Document signed date?"
99
  fieldA11 = "Singed Date"
100
- queryList = [queryA0, queryA1, queryA2, queryA3, queryA4, queryA5, queryA6, queryA7, queryA8, queryA9, queryA10, queryA11]
101
- fieldList = [fieldA0, fieldA1, fieldA2, fieldA3, fieldA4, fieldA5, fieldA6, fieldA7, fieldA8, fieldA9, fieldA10, fieldA11]
 
 
 
 
102
 
103
  i = 0
104
  while i < len(queryList):
 
42
 
43
 
44
  def answer_predefined_questions(document_type):
45
+ queryList=[]
46
+ fieldList=[]
47
  if document_type == "Deed of Trust":
48
  #Create a list of questions around the relevant fields of a Deed of Trust(DOT) document
49
  query0 = "what is the Lender's Name?"
 
70
  field10 = "Property County"
71
  query11 = "what is the Electronically recorded date"
72
  field11 = "Electronic Recording Date"
73
+ queryListForDOT = [query0, query1, query2, query3, query4, query5, query6, query7, query8, query9, query10, query11]
74
+ fieldListForDOT = [field0, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11]
75
+ for query in queryListForDOT:
76
+ queryList.append(query)
77
+ for field in fieldListForDOT:
78
+ fieldList.append(field)
79
 
80
  elif document_type == "Transmittal Summary":
81
  #Create a list of questions around the relevant fields of a TRANSMITTAL SUMMARY document
 
103
  fieldA10 = "Seller"
104
  queryA11 = "Document signed date?"
105
  fieldA11 = "Singed Date"
106
+ queryListForTransmittalSummary = [queryA0, queryA1, queryA2, queryA3, queryA4, queryA5, queryA6, queryA7, queryA8, queryA9, queryA10, queryA11]
107
+ fieldListForTransmittalSummary = [fieldA0, fieldA1, fieldA2, fieldA3, fieldA4, fieldA5, fieldA6, fieldA7, fieldA8, fieldA9, fieldA10, fieldA11]
108
+ for query in queryListForTransmittalSummary:
109
+ queryList.append(query)
110
+ for field in fieldListForTransmittalSummary:
111
+ fieldList.append(field)
112
 
113
  i = 0
114
  while i < len(queryList):