Calculate Comet
POST
/calculate_comet
const url = 'https://example.com/calculate_comet';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source":"example","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_comet \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source": "example", "hypothesis": "example", "reference": "example" }'Calculate COMET score for a translation using source, hypothesis, and reference.
COMET is a neural evaluation metric that correlates better with human judgment than traditional metrics. It requires the source text in addition to hypothesis and reference.
Note: This calls the remote COMET model endpoint and may take longer than BLEU/CHRF.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
CometScoringRequest
object
source
required
Source
Original source text
string
hypothesis
required
Hypothesis
Machine translation to evaluate
string
reference
required
Reference
Reference translation
string
Examplegenerated
{ "source": "example", "hypothesis": "example", "reference": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
CometScoringResponse
object
Examplegenerated
{ "score": 1, "processing_time_ms": 1, "success": true, "error_message": "example"}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": {} } ]}