Spaces:
Paused
Paused
aadhar duplication is resolved
Browse files
layoutlmv3FineTuning/Layoutlm_inference/inference_handler.py
CHANGED
@@ -223,7 +223,18 @@ class ModelHandler(object):
|
|
223 |
"attachment_ifsc":IFSC,
|
224 |
"attachment_status":200}
|
225 |
if self.name == "aadhar":
|
226 |
-
aadhar_num = "".join(item['text'] for item in flattened_output_list[0]['output'] if item['label'] == 'AN')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
print("entered aadhar\n\n",flattened_output_list,"\n\n")
|
228 |
# IFSC = "".join(item['text'] for item in flattened_output_list[0]['output'] if item['label'] == 'IFSC')
|
229 |
result = {"attachment_num":aadhar_num,
|
|
|
223 |
"attachment_ifsc":IFSC,
|
224 |
"attachment_status":200}
|
225 |
if self.name == "aadhar":
|
226 |
+
# aadhar_num = "".join(item['text'] for item in flattened_output_list[0]['output'] if item['label'] == 'AN')
|
227 |
+
output_ls = []
|
228 |
+
|
229 |
+
for item in flattened_output_list[0]['output']:
|
230 |
+
if item['label'] == 'AN' and item['text'] not in output_ls:
|
231 |
+
print("outputls",output_ls)
|
232 |
+
print("item['text']",item['text'])
|
233 |
+
|
234 |
+
output_ls.append(item['text'])
|
235 |
+
print("output_ls aadhar",output_ls)
|
236 |
+
aadhar_num = "".join(item for item in output_ls)
|
237 |
+
|
238 |
print("entered aadhar\n\n",flattened_output_list,"\n\n")
|
239 |
# IFSC = "".join(item['text'] for item in flattened_output_list[0]['output'] if item['label'] == 'IFSC')
|
240 |
result = {"attachment_num":aadhar_num,
|