Text shingle similarity

text-shingle-similarity · version 1.0.0 · Text · free, no key needed

Exact shingle-set resemblance (Jaccard) and containment of two texts, with counts and shared shingles.

Use when you need to: jaccard similarity of two texts using shingles · how similar are these two answers word for word · compute broder resemblance and containment.

Decide before calling

Read the versioned contract and the supported scope below. Reuse text-shingle-similarity@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-shingle-similarity@1.0.0 for jaccard similarity of two texts using shingles. 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:

{
  "text_a": "a rose is a rose is a rose",
  "text_b": "a rose is a flower which is a rose",
  "shingle_unit": "word",
  "shingle_size": 2
}

Response:

{
  "result": {
    "shingles_a": 3,
    "shingles_b": 6,
    "intersection": 3,
    "union": 6,
    "resemblance": 0.5,
    "containment_a_in_b": 1,
    "containment_b_in_a": 0.5,
    "shared_shingles": [
      "a rose",
      "is a",
      "rose is"
    ],
    "shared_truncated": false
  }
}

How to call it

MCP

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

{
  "id": "text-shingle-similarity",
  "version": "1.0.0",
  "input": {
    "text_a": "a rose is a rose is a rose",
    "text_b": "a rose is a flower which is a rose",
    "shingle_unit": "word",
    "shingle_size": 2
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-shingle-similarity/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text_a":"a rose is a rose is a rose","text_b":"a rose is a flower which is a rose","shingle_unit":"word","shingle_size":2}'

The machine-readable contract is at /v1/tools/text-shingle-similarity/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.