RAG Dataset Cleaner - Text Deduplication and Source URLs avatar

RAG Dataset Cleaner - Text Deduplication and Source URLs

Pricing

from $0.48 / 1,000 document record inspecteds

Go to Apify Store
RAG Dataset Cleaner - Text Deduplication and Source URLs

RAG Dataset Cleaner - Text Deduplication and Source URLs

Deduplicate crawler text for RAG datasets. Export exact-unique JSONL with grouped source URLs, empty-record diagnostics and near-duplicate review flags.

Pricing

from $0.48 / 1,000 document record inspecteds

Rating

0.0

(0)

Developer

Dhan sites

Dhan sites

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

20 hours ago

Last modified

Features

Limited permissions

Share

Deduplicate crawler text for RAG datasets. Export exact-unique JSONL with grouped source URLs, empty-record diagnostics and near-duplicate review flags.

See the result before you run

The prefilled example contains five fictional help-centre crawler records. URLs are labels; this Actor does not visit them.

InputResult
3 identical delivery-policy texts with different source URLs1 verbatim document preserving all 3 source references
1 different returns-policy text1 separate verbatim document
1 whitespace-only recordEmpty-text diagnostic; no candidate document

5 processed records → 2 exact-unique candidate documents, 2 duplicates grouped, 1 empty record flagged. Four nonempty-record source references are preserved in the candidate export. The empty record remains visible in the decision dataset and report. Source records are not deleted. These are measured fixture results, not a promise about your dataset or retrieval accuracy.

Quick start

  1. Open the Input tab or the public Example task and restore the example input.
  2. Run the five prefilled fictional records with Maximum documents set to 5. They have $0.003 in Actor event fees at the entry-tier rate, including duplicate and empty-text diagnostics. Review the Pricing tab for tier discounts and any separately displayed platform costs. The smaller copy-and-run example below uses three records ($0.0018 at the entry tier).
  3. Open START_HERE.md first, then inspect the dataset and REPORT for coverage and diagnostics. A successful execution alone does not establish that all requested work was completed.
  4. Download CLEAN_DOCUMENTS.jsonl for candidate documents and MANIFEST for their grouped sources. To use a crawler dataset, clear Inline document records first, select Source crawler dataset and grant READ permission. These two input modes cannot be combined. Set textField if your crawler stores text outside markdown or text.

The same five-record demo, via API

{
"records": [
{
"url": "https://example.com/help/delivery",
"markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
},
{
"url": "https://example.com/help/delivery?utm_source=newsletter",
"markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
},
{
"url": "https://example.com/help/returns",
"markdown": "# Returns policy\nUnused products can be returned within fourteen days of delivery. Keep the original packaging and contact support for return instructions before sending the parcel. Refunds are processed after the returned item has been inspected. This sample policy is fictional demonstration content.\n"
},
{
"url": "https://example.com/archive/delivery",
"markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
},
{
"url": "https://example.com/help/empty",
"markdown": " "
}
],
"maxDocuments": 5
}

What to open after the run

  1. START_HERE.md — the actual result counts, coverage warnings and what to do next. It also explains invalid input without promising nonexistent exports.
  2. CLEAN_DOCUMENTS.jsonl — candidate verbatim text with content hashes and grouped source references.
  3. MANIFEST — source references and export coverage. Empty or invalid records are accounted for in the decision dataset instead.
  4. REPORT and the default dataset — full decisions, review flags and coverage.

For the five-record fixture, expect 2 unique documents, 2 grouped duplicates, 1 empty record and 4 nonempty source references. New runs compute their own results; these counts are not a promise for other inputs.

Input reference

FieldTypeRequiredDescription
recordsarrayNoSmall JSON array of objects containing markdown or text and optional url. Use instead of a source dataset.
sourceDatasetIdstringNoSelect one dataset containing source text. Cannot be combined with inline records.
maxDocumentsintegerNoRead/process at most this many source rows,1-1000. Larger inputs are explicitly incomplete.
textFieldstringNoDot-separated object path. Leave empty to prefer markdown then text automatically.
urlFieldstringNoDot-separated object path, default url. URLs are metadata only and never fetched.

Advanced workflow

Pipeline-ready candidate JSONL and provenance manifest

CLEAN_DOCUMENTS.jsonl exports one retained exact-unique text per line with its content hash and every grouped source reference. MANIFEST describes exported documents, duplicate_groups, preserved source counts, review requirement and original coverage. REPORT adds duplicate_groups, flag_counts, duplicate_fraction_of_processed and per-record text_metrics. Whitespace word count is not token count. Exports preserve supplied text verbatim; sources remain user-provided labels. Near-duplicates and boilerplate remain review flags, never automatic removals. No source dataset or vector index is modified.

Pricing

$0.6 per 1,000 processed source rows ($0.0006 each) at the entry tier. Per-record diagnostics count as processed records; invalid top-level input has no record event fee. No run-start event or automatic output-row event. The Pricing tab shows the applicable subscription-tier price. The spending limit can reduce the number of processed items.

For example, 100 billable items cost $0.06 in Actor event fees at the entry tier. Zero findings is different from zero processed items. Inspect the report's processed/checked counts and the run's charge events to reconcile a run.

Limits and interpretation

Process at most maxDocuments, up to 1,000 rows. Inline records and a source dataset are alternative input modes. Dataset access is read-only and subject to the caller's permissions. Near-duplicates and repeated boilerplate are review flags, never automatic removals. Source URLs are supplied labels and are not fetched. No paid AI model, embedding generation or vector-database write is performed.

Results cover only the inspected input. Truncation and unchecked records require review; do not treat them as a complete-source guarantee. Input is not overwritten. The Actor uses limited permissions.

Troubleshooting and support

  • Run succeeded but output is diagnostic: inspect REPORT and INPUT_ERRORS, correct the named fields, and rerun. Handled invalid input can finish with SUCCEEDED and no billable items.
  • Fewer results than requested: check coverage, truncation, spending limits and the limits above. In dataset mode, check dataset availability, READ permission and the selected text field. No websites are fetched.
  • Repeat a workflow: save a task with your input and use Apify scheduling or its API. Review each run's coverage before passing results downstream.
  • Report a problem: open this Actor's Issues tab with the run ID, expected behavior and a minimal non-sensitive input. Never post tokens, credentials or private source data.

Questions before your first run

Does it crawl the URLs? No. Supply crawler text inline or select an existing Apify dataset. URLs are source labels only.

Why am I charged for a duplicate or empty record? The Actor inspects source records to decide what can be exported. Billing is per inspected input record, not per retained document. Invalid top-level input has no document event fee.

Will slightly different prices or wording disappear? Exact grouping requires identical full text. Near-duplicate flags are for review only. Different texts remain separate candidates.

Which example should I use? Try the five-record source-preserving cleanup task. It uses fictional non-sensitive data and has $0.003 in entry-tier Actor event fees.

Can I use my own dataset? Clear the prefilled inline records, select your dataset, and grant READ permission. Check the text-field path and report coverage before using the output.

Who is this for?

RAG developers preparing crawler text for retrieval pipelines. Supply supported source records and keep provenance when removing exact duplicate text.

Frequently asked questions

Does this automatically remove near-duplicate documents?

Exact duplicates are grouped for the clean export. Near-duplicate findings are review flags rather than automatic removals, helping preserve meaningful differences. Inspect coverage and diagnostics.

How do I try it before using my full input?

Open the Input tab, review the prefilled example, and run a small batch with a spending limit. Inspect the dataset and report before increasing the batch. Examples can incur the documented inspection or analysis fee; an execution marked successful can still contain rejected records or incomplete coverage.

Can I use the Actor through an API or on a schedule?

Yes. Use Apify's Actor API or schedules. Keep credentials private and use the documented input fields. The pricing and limits below apply to API runs too.