Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,12 +25,13 @@ def process_xlsx(params):
|
|
| 25 |
return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
|
| 26 |
print(f"JSON : \n{params}")
|
| 27 |
addresses = params.get("urls", [])
|
|
|
|
| 28 |
# api = params.get("api", "")
|
| 29 |
# job_id = params.get("job_id", "")
|
| 30 |
|
| 31 |
solutions=[]
|
| 32 |
text_id = 0
|
| 33 |
-
for adress in addresses:
|
| 34 |
doc = nlp_ner(adress)
|
| 35 |
|
| 36 |
# Initialize the dictionary to store the results
|
|
@@ -45,7 +46,7 @@ def process_xlsx(params):
|
|
| 45 |
# Create the final output dictionary
|
| 46 |
#
|
| 47 |
output = {'text_id': text_id, 'answer': entities_dict}
|
| 48 |
-
obj = {"text": adress, "answer":output}
|
| 49 |
solutions.append(obj)
|
| 50 |
text_id = text_id+1
|
| 51 |
|
|
|
|
| 25 |
return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
|
| 26 |
print(f"JSON : \n{params}")
|
| 27 |
addresses = params.get("urls", [])
|
| 28 |
+
file_ids = params.get("normalfileID",[])
|
| 29 |
# api = params.get("api", "")
|
| 30 |
# job_id = params.get("job_id", "")
|
| 31 |
|
| 32 |
solutions=[]
|
| 33 |
text_id = 0
|
| 34 |
+
for adress,file_id in zip(addresses, file_ids):
|
| 35 |
doc = nlp_ner(adress)
|
| 36 |
|
| 37 |
# Initialize the dictionary to store the results
|
|
|
|
| 46 |
# Create the final output dictionary
|
| 47 |
#
|
| 48 |
output = {'text_id': text_id, 'answer': entities_dict}
|
| 49 |
+
obj = {"text": adress, "answer":output, "qcUser": None, "normalfileID": file_id}
|
| 50 |
solutions.append(obj)
|
| 51 |
text_id = text_id+1
|
| 52 |
|