Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,18 +63,34 @@ def answer_predefined_questions(document_type):
|
|
63 |
#Create a list of questions around the relevant fields of a Deed of Trust(DOT) document
|
64 |
query1 = "what is the Loan Number?"
|
65 |
field1 = "Loan Number"
|
66 |
-
query2 = "
|
67 |
field2 = "Borrower"
|
68 |
query3 = "what is the Case Number?"
|
69 |
field3 = "Case Number"
|
70 |
query4 = "what is the Mortgage Identification number?"
|
71 |
field4 = "MIN Number"
|
72 |
query5 = "DOT signed date?"
|
73 |
-
field5 = "Signed Date"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
elif document_type == "Transmittal Summary":
|
76 |
#Create a list of questions around the relevant fields of a TRANSMITTAL SUMMARY document
|
77 |
-
query1 = "
|
78 |
field1 = "Borrower"
|
79 |
query2 = "what is the Property Address?"
|
80 |
field2 = "Property Address"
|
@@ -83,13 +99,29 @@ def answer_predefined_questions(document_type):
|
|
83 |
query4 = "What is the Base Income?"
|
84 |
field4 = "Base Income"
|
85 |
query5 = "what is the Borrower's SSN?"
|
86 |
-
field5 = "Borrower SSN"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
else:
|
89 |
return "Please choose your Document Type"
|
90 |
|
91 |
-
queryList = [query1, query2, query3, query4, query5]
|
92 |
-
fieldList = [field1, field2, field3, field4, field5]
|
93 |
responseList =[]
|
94 |
|
95 |
i = 0
|
@@ -98,7 +130,9 @@ def answer_predefined_questions(document_type):
|
|
98 |
responseList.append(pdf_qa.run(question))
|
99 |
i = i+1
|
100 |
|
101 |
-
return pd.DataFrame({"Field": [fieldList[0],
|
|
|
|
|
102 |
|
103 |
|
104 |
|
|
|
63 |
#Create a list of questions around the relevant fields of a Deed of Trust(DOT) document
|
64 |
query1 = "what is the Loan Number?"
|
65 |
field1 = "Loan Number"
|
66 |
+
query2 = "Who is the Borrower?"
|
67 |
field2 = "Borrower"
|
68 |
query3 = "what is the Case Number?"
|
69 |
field3 = "Case Number"
|
70 |
query4 = "what is the Mortgage Identification number?"
|
71 |
field4 = "MIN Number"
|
72 |
query5 = "DOT signed date?"
|
73 |
+
field5 = "Signed Date"
|
74 |
+
query6 = "Who is the Lender?"
|
75 |
+
field6 = "Lender"
|
76 |
+
query7 = "what is the VA/FHA Number?"
|
77 |
+
field7 = "VA/FHA Number"
|
78 |
+
query8 = "Who is the Co-Borrower?"
|
79 |
+
field8 = "Co-Borrower"
|
80 |
+
query9 = "What is the property type - single family, multi family?"
|
81 |
+
field9 = "Property Type"
|
82 |
+
query10 = "what is the Property Address?"
|
83 |
+
field10 = "Property Address"
|
84 |
+
query11 = "In what County is the property located?"
|
85 |
+
field11 = "Property County"
|
86 |
+
query12 = "what is the Electronically recorded date"
|
87 |
+
field12 = "Electronic Recording Date"
|
88 |
+
|
89 |
+
|
90 |
|
91 |
elif document_type == "Transmittal Summary":
|
92 |
#Create a list of questions around the relevant fields of a TRANSMITTAL SUMMARY document
|
93 |
+
query1 = "Who is the Borrower?"
|
94 |
field1 = "Borrower"
|
95 |
query2 = "what is the Property Address?"
|
96 |
field2 = "Property Address"
|
|
|
99 |
query4 = "What is the Base Income?"
|
100 |
field4 = "Base Income"
|
101 |
query5 = "what is the Borrower's SSN?"
|
102 |
+
field5 = "Borrower's SSN"
|
103 |
+
query6 = "Who is the Co-Borrower?"
|
104 |
+
field6 = "Co-Borrower"
|
105 |
+
query7 = "What is the Original Loan Amount?"
|
106 |
+
field7 = "Original Loan Amount"
|
107 |
+
query8 = "What is the Initial P&I payment?"
|
108 |
+
field8 = "Initial P&I payment"
|
109 |
+
query9 = "What is the Co-Borrower's SSN?"
|
110 |
+
field9 = "Co-Borrower’s SSN"
|
111 |
+
query10 = "Number of units?"
|
112 |
+
field10 = "Units#"
|
113 |
+
query11 = "Who is the Seller?"
|
114 |
+
field11 = "Seller"
|
115 |
+
query12 = "Document signed date?"
|
116 |
+
field12 = "Signed Date"
|
117 |
+
|
118 |
+
|
119 |
|
120 |
else:
|
121 |
return "Please choose your Document Type"
|
122 |
|
123 |
+
queryList = [query1, query2, query3, query4, query5, query6, query7, query8, query9, query10, query11,query12]
|
124 |
+
fieldList = [field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11,field12]
|
125 |
responseList =[]
|
126 |
|
127 |
i = 0
|
|
|
130 |
responseList.append(pdf_qa.run(question))
|
131 |
i = i+1
|
132 |
|
133 |
+
return pd.DataFrame({"Field": [fieldList[0],fieldList[1],fieldList[2],fieldList[3],fieldList[4],fieldList[5],fieldList[6],fieldList[7],fieldList[8],fieldList[9],fieldList[10],fieldList[11]],
|
134 |
+
"Question to gpt-4": [queryList[0],queryList[1],queryList[2],queryList[3],queryList[4],queryList[5],queryList[6],queryList[7],queryList[8],queryList[9],queryList[10],queryList[11]],
|
135 |
+
"Response from gpt-4": [responseList[0],responseList[1],responseList[2],responseList[3],responseList[4],responseList[5],responseList[6],responseList[7],responseList[8],responseList[9],responseList[10],responseList[11]]})
|
136 |
|
137 |
|
138 |
|