API Reference
Document question answering (image + optional word_boxes)
POST
/
v1
/
question-answering
/
document
Document question answering (image + optional word_boxes)
curl --request POST \
--url https://api.synapsai.cloud/v1/question-answering/document \
--header 'Content-Type: application/json' \
--data '
{
"image": "<string>",
"question": "<string>",
"word_boxes": [
"<string>"
],
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": false,
"lang": "<string>",
"tesseract_config": "<string>",
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/question-answering/document"
payload = {
"image": "<string>",
"question": "<string>",
"word_boxes": ["<string>"],
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": False,
"lang": "<string>",
"tesseract_config": "<string>",
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"score": 123,
"start": 123,
"end": 123,
"answer": "<string>",
"words": [
123
]
}Body
application/json
Request for document (image) question answering pipelines.
⌘I
Document question answering (image + optional word_boxes)
curl --request POST \
--url https://api.synapsai.cloud/v1/question-answering/document \
--header 'Content-Type: application/json' \
--data '
{
"image": "<string>",
"question": "<string>",
"word_boxes": [
"<string>"
],
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": false,
"lang": "<string>",
"tesseract_config": "<string>",
"timeout": 123
}
'import requests
url = "https://api.synapsai.cloud/v1/question-answering/document"
payload = {
"image": "<string>",
"question": "<string>",
"word_boxes": ["<string>"],
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": False,
"lang": "<string>",
"tesseract_config": "<string>",
"timeout": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"score": 123,
"start": 123,
"end": 123,
"answer": "<string>",
"words": [
123
]
}