This project explores efficient blocking strategies for entity matching in large-scale datasets (e.g., e-commerce product catalogs). We implement and evaluate three approaches:
- Rule-based blocking (heuristic filters),
- N-gram inverted index with TF-IDF,
- FAISS-based semantic search with Sentence Transformers.
- Datasets: Due to size constraints, the
.csvfiles are not included in this repository. To run the code:- Download the datasets from [source link, if any]
- Update file paths in the code (e.g.,
data_path = "your/local/path.csv").
- Dependencies: If
requirements.txtmisses any packages, install them manually.
Purpose: Implements heuristic blocking using exact/fuzzy string matching on product attributes (name, brand).
Key Features:
- Normalizes text (lowercase, remove punctuation).
- Applies Levenshtein distance for fuzzy matching (threshold=80%).
- Filters junk entries (e.g., short product names).
Purpose: Two-stage blocking using character-level n-grams and TF-IDF cosine similarity.
Key Features:
- Builds an inverted index for fast candidate retrieval.
- Uses TF-IDF vectors with character n-grams (e.g., n=5).
- Retains pairs with similarity > 0.8.
Purpose: Leverages Sentence-BERT embeddings and FAISS for GPU-accelerated semantic blocking.
Key Features:
- Encodes text using
all-MiniLM-L6-v2embeddings. - Builds a FAISS index for approximate nearest neighbor search.
- Supports CPU/GPU execution (via
faiss-gpu).
- Install dependencies:
pip install -r requirements.txt