Giter Club home page Giter Club logo

rltk's Introduction

RLTK: Record Linkage ToolKit

License Github actions Coveralls pypi Documents

The Record Linkage ToolKit (RLTK) is a general-purpose open-source record linkage platform that allows users to build powerful Python programs that link records referring to the same underlying entity. Record linkage is an extremely important problem that shows up in domains extending from social networks to bibliographic data and biomedicine. Current open platforms for record linkage have problems scaling even to moderately sized datasets, or are just not easy to use (even by experts). RLTK attempts to address all of these issues.

RLTK supports a full, scalable record linkage pipeline, including multi-core algorithms for blocking, profiling data, computing a wide variety of features, and training and applying machine learning classifiers based on Python’s sklearn library. An end-to-end RLTK pipeline can be jump-started with only a few lines of code. However, RLTK is also designed to be extensible and customizable, allowing users arbitrary degrees of control over many of the individual components. You can add new features to RLTK (e.g. a custom string similarity) very easily.

RLTK is being built by the Center on Knowledge Graphs at USC/ISI, with funding from multiple projects funded by the DARPA LORELEI and MEMEX programs and the IARPA CAUSE program. RLTK is under active maintenance and we expect to keep adding new features and state-of-the-art record linkage algorithms in the foreseeable future, in addition to continuously supporting our adopters to integrate the platform into their applications.

Getting Started

Installation (make sure prerequisites are installed):

pip install -U rltk

Example:

>>> import rltk
>>> rltk.levenshtein_distance('abc', 'abd')
1

Try RLTK Online

Datasets & Experiments

Documentation

rltk's People

Contributors

chinmay26 avatar cybergla avatar dhvanan avatar greatyyx avatar lituta avatar mit2nil avatar saggu avatar szeke avatar yli909 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rltk's Issues

Incorrect formula for F-measure?

 @property
    def f_measure(self) -> float:
        """
        Based on the mathematical formula:
            f_measure = 2 * true positive / (2 * true positive + false positive + false negative)
        Calculate and return the f_measure

        Returns:
            f_measure (float)
        """
        return 1 / 2 * (self.precision + self.recall)

Shouldn't the f_measure be the harmonic mean of precision and recall? That is,

f_measure = 2 * (precision * recall) / (precision + recall)

Right now it just seems to return half of precision + recall

Create 5 test datasets from ULAN

The smallest dataset should contain 10,000 records and the largest should the full datasets. The remaining 3 should be somewhere in the middle.

rltk.CrfTokenizer() no longer available?

I was following a tutorial using rltk.CrfTokenizer() but in the latest version, the code seems to have migrated elsewhere. Could you help me figure out how to now instantiate a tokenizer, i.e., the new equivalent of the old:

Tagging recent contributors: @saggu

tokenizer = rltk.CrfTokenizer()

Optimise simialrity metrics

For Jaccard similarity, we can calculate union length / intersection length from De-Morgan's laws. There is no need to perform another set operation. This optimization saves around ~60s on 100K records computations.

Better to inspect other similarity metrics for other code optimizations.

Incorrect JaroWinkler similarity score

RLTK returns incorrect score for Jaro Winkler similarity metric for the following pair: ("United Kingdom", "Sengenia (United Kingdom)").

Test:

import jaro
import rltk.similarity as sim
import py_stringmatching.similarity_measure.jaro_winkler
import py_stringmatching.similarity_measure.jaro
import rapidfuzz.distance

key = "United Kingdom"
query = "Sengenia (United Kingdom)"

print(sim.jaro_winkler_similarity(key, query, threshold=0.7, scaling_factor=0.1, prefix_len=4))
jw = py_stringmatching.similarity_measure.jaro_winkler.JaroWinkler(); print(jw.get_raw_score(key, query))
print(jaro.jaro_winkler_metric(key, query))
print(rapidfuzz.distance.JaroWinkler.similarity(key, query, score_cutoff=0.7, prefix_weight=0.1))

Output:

0.5054761904761905
0.7342857122421265
0.7342857142857143
0.7342857142857143

Similarly, the Jaro metric is also incorrect.

Exception Handling in File Iterator

We need custom exceptions to handle different cases such as

  • Malformed json / text
  • Missing id

Currently, I cannot distinguish between the two in record indexing. Having well defined exception classes will help in finer control during indexing

Logger module

RLTK is missing a wrapper logger module when executing a workflow. The logger module should support log levels such as

  • Error
  • Warnings
  • Info

Script to compute reduction ratio

Add to rltk a script to compute reduction ratio.

Consult with Yixiang whether this script exists already and where it should go.

Ideally, this script should work with the blocks of any blocking algorithm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.