Chrf compute

chrf-compute · version 1.0.0 · Text · free, no key needed

Compute exact chrF (character 6-gram F-beta, Popovic 2015) for hypothesis/reference segments, corpus and per segment.

Use when you need to: compute chrF score for a translation against a reference · character n-gram F-score chrF2 for machine translation output · corpus-level chrF over aligned hypothesis and reference segments.

Decide before calling

Read the versioned contract and the supported scope below. Reuse chrf-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 chrf-compute@1.0.0 for compute chrF score for a translation against a reference. 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:

{
  "hypotheses": [
    "The relationship between cats and dogs is not exactly friendly.",
    "a good bookshop is just a genteel black hole that knows how to read."
  ],
  "references": [
    "The relationship between dogs and cats is not exactly friendly.",
    "A good bookshop is just a genteel Black Hole that knows how to read."
  ]
}

Response:

{
  "result": {
    "metric": "chrF",
    "char_order": 6,
    "word_order": 0,
    "beta": 2,
    "lowercase": false,
    "segment_count": 2,
    "score": "84.642149",
    "score_fraction": "7116866012380/84081820977",
    "segment_scores": [
      "84.411311",
      "84.867055"
    ]
  }
}

How to call it

MCP

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

{
  "id": "chrf-compute",
  "version": "1.0.0",
  "input": {
    "hypotheses": [
      "The relationship between cats and dogs is not exactly friendly.",
      "a good bookshop is just a genteel black hole that knows how to read."
    ],
    "references": [
      "The relationship between dogs and cats is not exactly friendly.",
      "A good bookshop is just a genteel Black Hole that knows how to read."
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/chrf-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"hypotheses":["The relationship between cats and dogs is not exactly friendly.","a good bookshop is just a genteel black hole that knows how to read."],"references":["The relationship between dogs and cats is not exactly friendly.","A good bookshop is just a genteel Black Hole that knows how to read."]}'

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

CLI

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

Get the client at /clients/cli/.