Calculate Bleu
POST
/calculate_bleu
const url = 'https://example.com/calculate_bleu';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"hypothesis":"example","reference":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/calculate_bleu \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "hypothesis": "example", "reference": "example" }'Submit a BLEU score calculation task (async).
BLEU (Bilingual Evaluation Understudy) is a precision-based metric that measures how well a machine translation matches a reference translation.
Returns a task_id immediately. Use GET /score/{task_id} to check status and retrieve results.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ScoringRequest
object
hypothesis
required
Hypothesis
Machine translation to evaluate
string
reference
required
Reference
Reference translation
string
Examplegenerated
{ "hypothesis": "example", "reference": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
AsyncScoringSubmission
object
task_id
required
Task Id
Celery task ID for tracking the scoring job
string
status
Status
Initial status of the task
string
Example
{ "status": "pending"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}