Chrf plus plus compute

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

Compute exact chrF++ (character 6-grams plus word 1-2-grams, Popovic 2017) with the word tokens it scored.

Use when you need to: compute chrF++ score for machine translation output · chrF++ with character 6-grams and word bigrams against a reference · chrF2++ corpus score over aligned segments.

Decide before calling

Read the versioned contract and the supported scope below. Reuse chrf-plus-plus-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-plus-plus-compute@1.0.0 for compute chrF++ score for machine translation output. 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": 2,
    "beta": 2,
    "lowercase": false,
    "segment_count": 2,
    "score": "82.872637",
    "score_fraction": "40260030811255/485806076756",
    "segment_scores": [
      "83.308483",
      "82.578862"
    ],
    "word_tokens": [
      {
        "hypothesis": [
          "The",
          "relationship",
          "between",
          "cats",
          "and",
          "dogs",
          "is",
          "not",
          "exactly",
          "friendly",
          "."
        ],
        "reference": [
          "The",
          "relationship",
          "between",
          "dogs",
          "and",
          "cats",
          "is",
          "not",
          "exactly",
          "friendly",
          "."
        ]
      },
      {
        "hypothesis": [
          "a",
          "good",
          "bookshop",
          "is",
          "just",
          "a",
          "genteel",
          "black",
          "hole",
          "that",
          "knows",
          "how",
          "to",
          "read",
          "."
        ],
        "reference": [
          "A",
          "good",
          "bookshop",
          "is",
          "just",
          "a",
          "genteel",
          "Black",
          "Hole",
          "that",
          "knows",
          "how",
          "to",
          "read",
          "."
        ]
      }
    ]
  }
}

How to call it

MCP

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

{
  "id": "chrf-plus-plus-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-plus-plus-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-plus-plus-compute/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.