Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -129,12 +129,9 @@ ORNEK NER OUTPUT
|
|
129 |
"start": 72,
|
130 |
"end": 79
|
131 |
}
|
132 |
-
]
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
|
|
|
138 |
|
139 |
# this is not in use due to content filter
|
140 |
def openai_response(ocr_input):
|
@@ -150,27 +147,27 @@ def openai_response(ocr_input):
|
|
150 |
Output:
|
151 |
"""
|
152 |
|
153 |
-
openai_client = OpenAI_API()
|
154 |
-
response = openai_client.single_request(ocr_input)
|
155 |
-
resp = response["choices"][0]["text"]
|
156 |
-
print(resp)
|
157 |
-
resp = eval(resp.replace("'{", "{").replace("}'", "}"))
|
158 |
-
resp["input"] = ocr_input
|
159 |
-
dict_keys = [
|
160 |
-
|
161 |
-
'distinct',
|
162 |
-
'neighbourhood',
|
163 |
-
'street',
|
164 |
-
'no',
|
165 |
-
'tel',
|
166 |
-
'name_surname',
|
167 |
-
'address',
|
168 |
-
'input',
|
169 |
-
]
|
170 |
-
for key in dict_keys:
|
171 |
-
if key not in resp.keys():
|
172 |
-
resp[key] = ''
|
173 |
-
return resp
|
174 |
|
175 |
|
176 |
|
|
|
129 |
"start": 72,
|
130 |
"end": 79
|
131 |
}
|
132 |
+
]
|
|
|
|
|
|
|
|
|
133 |
|
134 |
+
"""
|
135 |
|
136 |
# this is not in use due to content filter
|
137 |
def openai_response(ocr_input):
|
|
|
147 |
Output:
|
148 |
"""
|
149 |
|
150 |
+
# openai_client = OpenAI_API()
|
151 |
+
# response = openai_client.single_request(ocr_input)
|
152 |
+
# resp = response["choices"][0]["text"]
|
153 |
+
# print(resp)
|
154 |
+
# resp = eval(resp.replace("'{", "{").replace("}'", "}"))
|
155 |
+
# resp["input"] = ocr_input
|
156 |
+
# dict_keys = [
|
157 |
+
# 'city',
|
158 |
+
# 'distinct',
|
159 |
+
# 'neighbourhood',
|
160 |
+
# 'street',
|
161 |
+
# 'no',
|
162 |
+
# 'tel',
|
163 |
+
# 'name_surname',
|
164 |
+
# 'address',
|
165 |
+
# 'input',
|
166 |
+
# ]
|
167 |
+
# for key in dict_keys:
|
168 |
+
# if key not in resp.keys():
|
169 |
+
# resp[key] = ''
|
170 |
+
# return resp
|
171 |
|
172 |
|
173 |
|