Text Near Duplicate Finder avatar

Text Near Duplicate Finder

Pricing

$3.00 / 1,000 results

Go to Apify Store
Text Near Duplicate Finder

Text Near Duplicate Finder

Pricing

$3.00 / 1,000 results

Rating

0.0

(0)

Developer

Eichan Jolly

Eichan Jolly

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Categories

Features

Limited permissions

Share

Text Near-Duplicate Finder

A deterministic, no-LLM tool for finding near-identical surface text among a small group of supplied strings. It emits only pairs whose token-shingle Jaccard similarity meets or exceeds a threshold. It never fetches web pages or calls a third-party API.

Who this is for

Dataset curators, RAG ingestion pipeline builders, article/content editors, and QA teams checking whether supplied documents or snippets are almost identical. It is not a plagiarism detector or semantic similarity model.

Inputs

  • texts (required): an array of 2–20 non-empty strings. Maximum combined length: 100,000 characters.
  • threshold (optional): a number from 0 to 1, default 0.8. A pair is emitted when the unrounded Jaccard value is greater than or equal to this threshold.

All pairs i < j are compared, at most 190 for 20 texts; original indices are zero-based. Every matching pair produces one Dataset item. Zero matches produce zero Dataset items, not a fabricated "no match" item.

Tiny working example

Input (same as the real input schema prefill):

{
"texts": [
"RAG chunks help search relevant text.",
"rag chunks help search relevant text!"
],
"threshold": 0.8
}

Dataset item:

{
"firstIndex": 0,
"secondIndex": 1,
"similarity": 1.0,
"method": "deterministic token 3-shingle Jaccard surface similarity (not semantic)"
}

There are no results for nonmatching pairs. In a 20-text input, the tool tests every i < j pair, even though it outputs only qualifying pairs. Similarity is rounded to six decimal places for display, not for threshold filtering.

Exact method and limitations

  1. Apply Unicode NFKC normalization and case-folding, then recognize sequences of Unicode word characters (excluding underscore). Punctuation changes and capitalization are usually ignored.
  2. Convert each text into a set of consecutive three-token shingles (3-grams). For 1–2 token inputs, the entire token sequence acts as the one shingle.
  3. Compute Jaccard similarity |shingles(A) ∩ shingles(B)| / |shingles(A) ∪ shingles(B)|.
  4. Retain all qualifying pairs; tie and output order are deterministic, ascending (firstIndex, secondIndex).

This is heuristic surface matching, not semantic understanding. Reworded passages may score low despite meaning the same thing. Common boilerplate and short texts may appear more similar than expected. A single Chinese or Japanese sentence may be treated as one long token because there is no word segmentation. Set comparison ignores shingle multiplicities, though word order inside each shingle matters. This Actor does not assess copying, authorship, intent, or legal similarity.

Input validation errors (including invalid list size, empty strings, missing required property, invalid threshold, and excessive total text size) print a plain-language error and exit without a traceback.

Run locally

Requires Python 3.12+; no dependencies to install. From the Actor folder:

$ACTOR_INPUT_JSON='{"texts":["RAG chunks help search relevant text.","rag chunks help search relevant text!"],"threshold":0.8}' python src/main.py

Or save a JSON object at storage/key_value_stores/default/INPUT.json and call python src/main.py. Local results are individual files under storage/datasets/default/ by default, or $APIFY_LOCAL_STORAGE_DIR/datasets/default/. Run python tests/run_smoke.py for a fresh temporary storage directory and verified script-mode output.

On Apify, with APIFY_IS_AT_HOME, the Actor retrieves the run's input from the default key-value store using Apify's REST API and the platform-injected APIFY_TOKEN, then appends nonempty matching items to the default Dataset via the same REST API. The Actor does not require login, LLM accounts, external model API keys, or the Apify SDK.

Store and suggested pricing (not configured)

  • Store category: AI.
  • Suggested price: $0.001 per matching pair result. No pair means no suggested per-result charge; actual price depends on later Apify configuration. This is a recommendation only; no billing configured or Actor published.

Verification

Run python -m unittest discover -s tests -v and python tests/run_smoke.py from this folder. Tests include local subprocess execution, threshold boundaries, zero-output handling, error paths, and mock Apify REST storage. Actual terminal output and the produced item from a valid python src/main.py run are included in tests/. Docker builds and real Apify runs have not been performed.