API Reference
Question answering on context
POST
/
v1
/
question-answering
Question answering on context
curl --request POST \
--url https://api.synapsai.cloud/v1/question-answering \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"context": "<string>",
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": false,
"align_to_words": true
}
'import requests
url = "https://api.synapsai.cloud/v1/question-answering"
payload = {
"question": "<string>",
"context": "<string>",
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": False,
"align_to_words": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"score": 123,
"start": 123,
"end": 123,
"answer": "<string>"
}Body
application/json
Request to ask questions about provided text context.
⌘I
Question answering on context
curl --request POST \
--url https://api.synapsai.cloud/v1/question-answering \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"context": "<string>",
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": false,
"align_to_words": true
}
'import requests
url = "https://api.synapsai.cloud/v1/question-answering"
payload = {
"question": "<string>",
"context": "<string>",
"top_k": 1,
"doc_stride": 128,
"max_answer_len": 15,
"max_seq_len": 384,
"max_question_len": 64,
"handle_impossible_answer": False,
"align_to_words": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"score": 123,
"start": 123,
"end": 123,
"answer": "<string>"
}