Text minhash cluster

text-minhash-cluster · version 1.0.0 · Text · free, no key needed

Cluster near-duplicate texts by fixed-seed MinHash signatures, with estimated Jaccard per pair.

Use when you need to: cluster near duplicate llm outputs with minhash · group almost identical responses together · compute minhash signatures for a batch of texts.

Decide before calling

Read the versioned contract and the supported scope below. Reuse text-minhash-cluster@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 text-minhash-cluster@1.0.0 for cluster near duplicate llm outputs with minhash. 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:

{
  "documents": [
    "a d",
    "c",
    "b d e",
    "a c d"
  ],
  "shingle_unit": "word",
  "shingle_size": 1,
  "element_ids": "universe_row",
  "modulus": 5,
  "hash_functions": [
    {
      "a": 1,
      "b": 1
    },
    {
      "a": 3,
      "b": 1
    }
  ],
  "threshold": 0.5,
  "include_signatures": true
}

Response:

{
  "result": {
    "num_hashes": 2,
    "modulus": 5,
    "clusters": [
      [
        0,
        2,
        3
      ],
      [
        1
      ]
    ],
    "pairs": [
      {
        "a": 0,
        "b": 3,
        "matching_hashes": 2,
        "estimate": 1
      },
      {
        "a": 0,
        "b": 2,
        "matching_hashes": 1,
        "estimate": 0.5
      },
      {
        "a": 2,
        "b": 3,
        "matching_hashes": 1,
        "estimate": 0.5
      }
    ],
    "pair_count": 3,
    "pairs_truncated": false,
    "shingle_counts": [
      2,
      1,
      3,
      3
    ],
    "signatures": [
      [
        1,
        0
      ],
      [
        3,
        2
      ],
      [
        0,
        0
      ],
      [
        1,
        0
      ]
    ]
  }
}

How to call it

MCP

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

{
  "id": "text-minhash-cluster",
  "version": "1.0.0",
  "input": {
    "documents": [
      "a d",
      "c",
      "b d e",
      "a c d"
    ],
    "shingle_unit": "word",
    "shingle_size": 1,
    "element_ids": "universe_row",
    "modulus": 5,
    "hash_functions": [
      {
        "a": 1,
        "b": 1
      },
      {
        "a": 3,
        "b": 1
      }
    ],
    "threshold": 0.5,
    "include_signatures": true
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-minhash-cluster/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"documents":["a d","c","b d e","a c d"],"shingle_unit":"word","shingle_size":1,"element_ids":"universe_row","modulus":5,"hash_functions":[{"a":1,"b":1},{"a":3,"b":1}],"threshold":0.5,"include_signatures":true}'

The machine-readable contract is at /v1/tools/text-minhash-cluster/versions/1.0.0.

CLI

node cli.mjs run text-minhash-cluster 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.