Bleu smoothing compute

bleu-smoothing-compute · version 1.0.0 · Text · free, no key needed

Apply none or Chen-Cherry smoothing 1-3 to BLEU match/total counts; return smoothed counts, BP and BLEU.

Use when you need to: BLEU score from sufficient statistics · smooth zero n-gram precisions with Chen and Cherry method 1, 2 or 3 · compute BLEU from matches totals and lengths.

Decide before calling

Read the versioned contract and the supported scope below. Reuse bleu-smoothing-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use bleu-smoothing-compute@1.0.0 for BLEU score from sufficient statistics. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "matches": [
    9,
    7,
    5,
    3
  ],
  "totals": [
    10,
    8,
    6,
    4
  ],
  "candidate_length": 11,
  "reference_length": 11,
  "smoothing": "none",
  "decimals": 10
}

Response:

{
  "result": {
    "bleu": 0.8375922397,
    "brevity_penalty": 1,
    "orders_used": 4,
    "smoothed_matches": [
      9,
      7,
      5,
      3
    ],
    "smoothed_totals": [
      10,
      8,
      6,
      4
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "bleu-smoothing-compute",
  "version": "1.0.0",
  "input": {
    "matches": [
      9,
      7,
      5,
      3
    ],
    "totals": [
      10,
      8,
      6,
      4
    ],
    "candidate_length": 11,
    "reference_length": 11,
    "smoothing": "none",
    "decimals": 10
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/bleu-smoothing-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"matches":[9,7,5,3],"totals":[10,8,6,4],"candidate_length":11,"reference_length":11,"smoothing":"none","decimals":10}'

The machine-readable contract is at /v1/tools/bleu-smoothing-compute/versions/1.0.0.

CLI

node cli.mjs run bleu-smoothing-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.