Skip to content

Metrics

Evaluate an existing source/translation pair independently of the translation endpoints — useful for QA pipelines or scoring translations produced outside Algebras.

Evaluates the fluency of a translation across five linguistic dimensions and provides improvement feedback.

Endpoint: POST /translation/fluency-score

Sent as JSON.

Field Type Required Description
sourceLang string yes Source language code
targetLang string yes Target language code
sourceText string yes The original text in the source language
translatedText string yes The translated text to evaluate

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": {
"fluency": 6.4,
"idiomatic": 7,
"collocational": 6,
"discourse": 7,
"pragmatic": 6,
"calque": 6,
"issue_type": "collocation",
"severity": "minor",
"problematic_phrase": "macht Sinn",
"suggested_fix": "ergibt Sinn",
"main_issue": "The phrase is a calque from English and unnatural in German."
}
}

fluency is the mean of the five dimensions (idiomatic, collocational, discourse, pragmatic, calque), each scored 1-10. issue_type is one of calque, collocation, idiom_literal, discourse_marker, register_mismatch, false_friend, or none. severity is one of critical, major, minor, or cosmetic.

Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/fluency-score" \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sourceLang": "en",
"targetLang": "de",
"sourceText": "That makes sense.",
"translatedText": "Das macht Sinn."
}'

Evaluates the fluency of up to 20 source/translation pairs concurrently. Individual item failures do not abort the whole batch.

Endpoint: POST /translation/fluency-batch

Sent as JSON.

Field Type Required Description
sourceLang string yes Source language code
targetLang string yes Target language code
items array of objects yes Pairs to evaluate (max 20)
items[].sourceText string yes The original text in the source language
items[].translatedText string yes The translated text to evaluate

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": {
"evaluations": [
{
"index": 0,
"fluency": 9.2,
"idiomatic": 9,
"collocational": 9,
"discourse": 9,
"pragmatic": 10,
"calque": 9,
"issue_type": "none",
"severity": null,
"problematic_phrase": null,
"suggested_fix": null,
"main_issue": null
},
{
"index": 1,
"fluency": 6.4,
"idiomatic": 7,
"collocational": 6,
"discourse": 7,
"pragmatic": 6,
"calque": 6,
"issue_type": "collocation",
"severity": "minor",
"problematic_phrase": "macht Sinn",
"suggested_fix": "ergibt Sinn",
"main_issue": "The phrase is a calque from English and unnatural in German."
}
],
"batch_summary": {
"total": 2,
"successful": 2,
"failed": 0
}
}
}
Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/fluency-batch" \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sourceLang": "en",
"targetLang": "de",
"items": [
{ "sourceText": "Hello, World!", "translatedText": "Hallo, Welt!" },
{ "sourceText": "That makes sense.", "translatedText": "Das macht Sinn." }
]
}'

Scores a translation on a continuous 0-100 Scalar Quality Metric (SQM/GEMBA-DA) scale, optionally informed by a human reference translation.

Endpoint: POST /translation/gemba

Sent as JSON.

Field Type Required Description
sourceLang string yes Source language code
targetLang string yes Target language code
sourceText string yes The original text in the source language
translatedText string yes The translated text to evaluate
referenceText string no Human reference translation used to calibrate the score

Success Response (200)

{
"status": "ok",
"timestamp": "2025-01-12T22:31:48.856Z",
"data": {
"score": 87.5
}
}

score ranges from 0 (no meaning preserved) to 100 (perfect meaning and grammar).

Terminal window
curl -X POST "https://platform.algebras.ai/api/v1/translation/gemba" \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sourceLang": "en",
"targetLang": "de",
"sourceText": "Hello, World!",
"translatedText": "Hallo, Welt!"
}'