Skip to content

Calculate Chrf

POST
/calculate_chrf
curl --request POST \
--url https://example.com/calculate_chrf \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "hypothesis": "example", "reference": "example" }'

Submit a CHRF score calculation task (async).

CHRF (Character n-gram F-score) is a character-level metric that can be more robust than BLEU for morphologically rich languages or shorter texts.

Returns a task_id immediately. Use GET /score/{task_id} to check status and retrieve results.

Media typeapplication/json
ScoringRequest
object
hypothesis
required
Hypothesis

Machine translation to evaluate

string
>= 1 characters
reference
required
Reference

Reference translation

string
>= 1 characters
Examplegenerated
{
"hypothesis": "example",
"reference": "example"
}

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
default: pending
Example
{
"status": "pending"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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": {}
}
]
}