comparator
Simple tool to compare almost similar names which are coming from the same source (for example list of all company owners and officers of that company). Helps to cluster together persons with a slight difference in name spelling/typos. Better suited for Cyrillic names, but should work everywhere.
It’s heuristic based and as any algorithm of such a nature it make errors sometime (see Accuracy section below for details).
Installation
Install from PyPI.
$ pip install names_comparator
Accuracy
You can test your installation on a ground truth data and check confusion matrix by running:
$ python comparator/__init__.py comparator/data/ground_truth.csv
+--------------------+----------+----------+
| | Positive | Negative |
+--------------------+----------+----------+
| Predicted positive | 290 | 9 |
| Predicted negative | 14 | 687 |
+--------------------+----------+----------+
Precision: 0.97
Recall: 0.95
F1 score: 0.96
You can also run it with debug flag to see all the errors algorithm made:
$ python comparator/__init__.py comparator/data/ground_truth.csv yes
Usage
>>> from comparator import full_compare
>>> full_compare("Barack Hussein Obama", "Obama, Barak")
True
>>> full_compare("Петро Мазепа", "Мазепа Петро")
True
>>> full_compare("Марченко Петро Миколайович", "Панченко Петро Миколайович")
False
>>> full_compare("Овдієнко Сергій Костантинович", "Овдієнко Сергій Костянтинович")
True
>>> full_compare("Іванов Михайло Юрійович", "Іванов Юрій Михайлович")
False
Metadata
Release files for names_comparator 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| names_comparator-1.0.0.tar.gz | 30.5 kB | Without provenance | Details for names_comparator-1.0.0.tar.gz |
Release files / names_comparator-1.0.0.tar.gz
| Download URL | names_comparator-1.0.0.tar.gz |
|---|---|
| Size | 30.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4c036215cae08efd07d110b84e01d75b5815ec0cbadde88fc495904b5b7c9b8
|
|
BLAKE2b-256 checksum How to use checksums |
7106d29a804841b19961339ca6c2d86ae85208d83f5fe2c93ff612097e4a0b80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for names_comparator 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.