Chrf components

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

Break down chrF/chrF++ into per-order n-gram counts, precision, recall and F, with configurable orders and averaging.

Use when you need to: chrF per-order n-gram precision and recall breakdown · show character and word n-gram match counts behind a chrF score · compute chrF with custom character and word n-gram orders.

Decide before calling

Read the versioned contract and the supported scope below. Reuse chrf-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 chrf-components@1.0.0 for chrF per-order n-gram precision and recall breakdown. 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": [
    "aa"
  ],
  "references": [
    "ab"
  ],
  "beta": 3
}

Response:

{
  "result": {
    "char_order": 6,
    "word_order": 0,
    "beta": 3,
    "lowercase": false,
    "include_whitespace": false,
    "averaging": "precision_recall",
    "segment_count": 1,
    "orders": [
      {
        "type": "char",
        "n": 1,
        "hypothesis_ngrams": 2,
        "reference_ngrams": 2,
        "matching_ngrams": 1,
        "effective": true,
        "precision": "1/2",
        "recall": "1/2",
        "f_score": "1/2"
      },
      {
        "type": "char",
        "n": 2,
        "hypothesis_ngrams": 1,
        "reference_ngrams": 1,
        "matching_ngrams": 0,
        "effective": true,
        "precision": "0/1",
        "recall": "0/1",
        "f_score": "0/1"
      },
      {
        "type": "char",
        "n": 3,
        "hypothesis_ngrams": 0,
        "reference_ngrams": 0,
        "matching_ngrams": 0,
        "effective": false,
        "precision": null,
        "recall": null,
        "f_score": null
      },
      {
        "type": "char",
        "n": 4,
        "hypothesis_ngrams": 0,
        "reference_ngrams": 0,
        "matching_ngrams": 0,
        "effective": false,
        "precision": null,
        "recall": null,
        "f_score": null
      },
      {
        "type": "char",
        "n": 5,
        "hypothesis_ngrams": 0,
        "reference_ngrams": 0,
        "matching_ngrams": 0,
        "effective": false,
        "precision": null,
        "recall": null,
        "f_score": null
      },
      {
        "type": "char",
        "n": 6,
        "hypothesis_ngrams": 0,
        "reference_ngrams": 0,
        "matching_ngrams": 0,
        "effective": false,
        "precision": null,
        "recall": null,
        "f_score": null
      }
    ],
    "effective_order_count": 2,
    "average_precision": "1/4",
    "average_recall": "1/4",
    "score": "25.000000",
    "score_fraction": "25/1"
  }
}

How to call it

MCP

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

{
  "id": "chrf-components",
  "version": "1.0.0",
  "input": {
    "hypotheses": [
      "aa"
    ],
    "references": [
      "ab"
    ],
    "beta": 3
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/chrf-components/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"hypotheses":["aa"],"references":["ab"],"beta":3}'

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

CLI

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

Get the client at /clients/cli/.