Transform entities like companies, products, etc. into vectors to support scalable Record Linkage / Entity Resolution using Approximate Nearest Neighbors.
Project description
Entity Embed
Entity Embed allows you to transform entities like companies, products, etc. into vectors to support scalable Record Linkage / Entity Resolution using Approximate Nearest Neighbors.
Using Entity Embed, you can train a deep learning model to transform records into vectors in an N-dimensional embedding space. Thanks to a contrastive loss, those vectors are organized to keep similar records close and dissimilar records far apart in this embedding space. Embedding records enables scalable ANN search, which means finding thousands of candidate duplicate pairs of records per second per CPU.
Entity Embed achieves Recall of ~0.99 with Pair-Entity ratio below 100 on a variety of datasets. Entity Embed aims for high recall at the expense of precision. Therefore, this library is suited for the Blocking/Indexing stage of an Entity Resolution pipeline. A scalabale and noise-tolerant Blocking procedure is often the main bottleneck for performance and quality on Entity Resolution pipelines, so this library aims to solve that. Note the ANN search on embedded records returns several candidate pairs that must be filtered to find the best matching pairs, possibly with a pairwise classifier (an example for that is available).
Entity Embed is based on and is a special case of the AutoBlock model described by Amazon.
⚠️ Warning: this project is under heavy development.
Documentation
https://entity-embed.readthedocs.io
Requirements
System
- MacOS or Linux (tested on latest MacOS and Ubuntu via GitHub Actions).
- Entity Embed can train and run on a powerful laptop. Tested on a system with 32 GBs of RAM, RTX 2070 Mobile (8 GB VRAM), i7-10750H (12 threads). With batch sizes smaller than 32 and few field types, it's possible to train and run even with 2 GB of VRAM.
Libraries
- Python: >= 3.6
- Numpy: >= 1.19.0
- PyTorch: >= 1.7.1
- PyTorch Lightning: >= 1.1.6
- N2: >= 0.1.7
And others, see requirements.txt.
Installation
pip install entity-embed
Examples
Run:
pip install -r requirements-examples.txt
Then check the example Jupyter Notebooks:
- Deduplication, when you have a single dirty dataset with duplicates: notebooks/Deduplication-Example.ipynb
- Record Linkage, when you have multiple clean datasets you need to link: notebooks/Record-Linkage-Example.ipynb
- After you run the notebooks/Record-Linkage-Example.ipynb, you can check the notebooks/End-to-End-Matching-Example.ipynb to learn how to integrate Entity Embed with a pairwise classifier.
Releases
See CHANGELOG.md.
Credits
This project is maintained by open-source contributors and Vinta Software.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage
project template.
Commercial Support
Vinta Software is always looking for exciting work, so if you need any commercial support, feel free to get in touch: contact@vinta.com.br
Citations
If you use Entity Embed in your research, please consider citing it.
BibTeX entry:
@software{entity-embed,
title = {{Entity Embed}: Scalable Entity Resolution using Approximate Nearest Neighbors.},
author = {Juvenal, Flávio and Vieira, Renato},
url = {https://github.com/vintasoftware/entity-embed},
version = {0.0.3},
date = {2021-04-20},
year = {2021}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file entity-embed-0.0.3.tar.gz
.
File metadata
- Download URL: entity-embed-0.0.3.tar.gz
- Upload date:
- Size: 52.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0ed7477b61d85dc03037b8968922410ff6008f2a1ad96b7373022afce20c2e |
|
MD5 | 770b6fa44be9c18f15da7d410b39e91a |
|
BLAKE2b-256 | 207ed837776008b07c137cc622c38f1413c6a7dbaa2f57ea0afe81fca0156c67 |
File details
Details for the file entity_embed-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: entity_embed-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71eee20495655cd728e0bbda6a4503215893a69db5c6f58d3e72d7157c8e895d |
|
MD5 | 443ce804076a654913459846c1921a40 |
|
BLAKE2b-256 | f47b350387613c624b31759c4ecf2814897e01bcf7cfa01b52126f51e72867b1 |