Skip to main content
POST
/
models
/
v2
/
deepset
/
roberta-base-squad2
question-answering
curl --request POST \
  --url https://api.bytez.com/models/v2/deepset/roberta-base-squad2 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "question": "Who's the lead character?",
  "context": "Ron, the hero, looked at Greybeard and smote him asunder"
}
EOF
{
  "error": "<string>",
  "output": {
    "score": 0.2002170979976654,
    "start": 0,
    "end": 3,
    "answer": "Ron"
  }
}

Authorizations

Authorization
string
header
required

Set Authorization header to BYTEZ_KEY 'Authorization: YOUR_BYTEZ_KEY_HERE'

Body

application/json

Schema for question-answering models

question
string
required
Example:

"Who's the lead character?"

context
string
required
Example:

"Ron, the hero, looked at Greybeard and smote him asunder"

Response

Successful question-answering response.

error
string | null
required

Null on success; otherwise an error message.

output
object
required

Successful response with the answer, score, and start and end indices

Example:
{
"score": 0.2002170979976654,
"start": 0,
"end": 3,
"answer": "Ron"
}