Scraped Data Deduplication

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Scraped Data Deduplication
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Implementing Deduplication of Scraped Data

Scraping multiple sources inevitably leads to duplicates: one product is present on the manufacturer's website, in three distributor catalogs, and on a marketplace. Naive comparison by URL or name works poorly — smarter approaches are needed.

Deduplication Levels

Level 1 — Exact Match. By normalized key: SKU, EAN/GTIN, manufacturer part number. Most reliable approach, works where unique identifier exists.

def normalize_sku(raw_sku: str) -> str:
    # remove spaces, hyphens, convert to uppercase
    return re.sub(r'[\s\-_/]', '', raw_sku).upper()

Level 2 — Content Hashing. For content (articles, descriptions) — normalize text and compute hash.

def content_hash(text: str) -> str:
    normalized = ' '.join(text.lower().split())  # remove extra spaces
    return hashlib.sha256(normalized.encode()).hexdigest()

Level 3 — Fuzzy Matching. For products without explicit SKU — compare names using Levenshtein distance or Token Sort/Token Set Ratio algorithms.

from rapidfuzz import fuzz, process

def find_duplicate(new_title: str, existing_titles: list[str], threshold=85):
    result = process.extractOne(
        new_title,
        existing_titles,
        scorer=fuzz.token_sort_ratio
    )
    if result and result[1] >= threshold:
        return result[0]
    return None

token_sort_ratio sorts words before comparison — works well with word reordering in product names.

Level 4 — Vector Similarity. For semantically meaningful texts — embeddings via sentence-transformers and cosine similarity.

from sentence_transformers import SentenceTransformer
import numpy as np

model = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2')

def are_similar(text1: str, text2: str, threshold=0.92) -> bool:
    embeddings = model.encode([text1, text2])
    cosine_sim = np.dot(embeddings[0], embeddings[1]) / (
        np.linalg.norm(embeddings[0]) * np.linalg.norm(embeddings[1])
    )
    return float(cosine_sim) >= threshold

For large volumes — index in pgvector (PostgreSQL) or Milvus for approximate vector search.

Performance

Pairwise comparison is unacceptable for millions of records. Strategies:

  • MinHash + LSH (Locality Sensitive Hashing) — fast candidate finding for duplicates in large text sets
  • Blocking — first filter by exact attributes (category, price range), then fuzzy comparison only within blocks
  • PostgreSQL indexespg_trgm for fuzzy string search with similarity() and % operator
-- Install extension
CREATE EXTENSION pg_trgm;
CREATE INDEX ON products USING GIN (title gin_trgm_ops);

-- Find similar titles
SELECT id, title, similarity(title, 'Iphone 15 pro max 256') AS sim
FROM products
WHERE title % 'Iphone 15 pro max 256'
ORDER BY sim DESC
LIMIT 10;

Duplicate Management

Found duplicates are not deleted automatically. The system forms groups of candidates with computed match score. Final decision — either automatic (when score > 95%) or through manual review interface.

Timeline for implementing multi-level deduplication system: 4–7 business days.