Bleu sentence components

bleu-sentence-components · version 1.0.0 · Text · free, no key needed

Extract sentence BLEU statistics: clipped matches, n-gram totals, candidate and closest reference length.

Use when you need to: sentence BLEU statistics for one hypothesis · matched and total n-grams of a single translation · hypothesis length and closest reference length for BLEU.

Decide before calling

Read the versioned contract and the supported scope below. Reuse bleu-sentence-components@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-sentence-components@1.0.0 for sentence BLEU statistics for one hypothesis. 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:

{
  "hypothesis": [
    "am",
    "I",
    "am",
    "a",
    "character",
    "sequence"
  ],
  "references": [
    [
      "I",
      "am",
      "a",
      "symbol",
      "string",
      "sequence",
      "a",
      "a"
    ]
  ]
}

Response:

{
  "result": {
    "candidate_length": 6,
    "reference_length": 8,
    "max_order": 4,
    "matches": [
      4,
      2,
      1,
      0
    ],
    "totals": [
      6,
      5,
      4,
      3
    ]
  }
}

How to call it

MCP

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

{
  "id": "bleu-sentence-components",
  "version": "1.0.0",
  "input": {
    "hypothesis": [
      "am",
      "I",
      "am",
      "a",
      "character",
      "sequence"
    ],
    "references": [
      [
        "I",
        "am",
        "a",
        "symbol",
        "string",
        "sequence",
        "a",
        "a"
      ]
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/bleu-sentence-components/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"hypothesis":["am","I","am","a","character","sequence"],"references":[["I","am","a","symbol","string","sequence","a","a"]]}'

The machine-readable contract is at /v1/tools/bleu-sentence-components/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.