jpjpjpjpjp commited on
Commit
90f0a50
1 Parent(s): 995ee90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -25,7 +25,7 @@ def analyze_image(image, question):
25
 
26
  response = requests.request("POST", url, headers=headers, data=payload)
27
  '''{"body": [{"doc": "/home/ubuntu/work/4187f911-c1fd-407c-a06b-bc6a0cc74cbe/1.png", "result": [{"question": "invoice date?", "answer": ["01 / 29 / 2010"], "start": 43, "end": 47, "score": 100.0}]}], "starttime": "Thu Mar 9 10:58:07 2023", "endtime": "Thu Mar 9 10:58:12 2023"}'''
28
- return {"Answer": response.text['body']['results']['answer'], "Confidence":response.text['body']['results']['score']}
29
 
30
  description = "Hyland Demo for Document Question & Answering , fine-tuned on DocVQA (document visual question answering). To use it, simply upload your image and type a question and click 'submit', or click one of the examples to load them. Read more at the links below."
31
  title = "DocVQA"
 
25
 
26
  response = requests.request("POST", url, headers=headers, data=payload)
27
  '''{"body": [{"doc": "/home/ubuntu/work/4187f911-c1fd-407c-a06b-bc6a0cc74cbe/1.png", "result": [{"question": "invoice date?", "answer": ["01 / 29 / 2010"], "start": 43, "end": 47, "score": 100.0}]}], "starttime": "Thu Mar 9 10:58:07 2023", "endtime": "Thu Mar 9 10:58:12 2023"}'''
28
+ return {"Answer": response.text['body']['results'][0]['answer'], "Confidence":response.text['body']['results'][0]['score']}
29
 
30
  description = "Hyland Demo for Document Question & Answering , fine-tuned on DocVQA (document visual question answering). To use it, simply upload your image and type a question and click 'submit', or click one of the examples to load them. Read more at the links below."
31
  title = "DocVQA"