New Matching Algorithm (Contact Syncing across all Apps)

New Matching Algorithm (Contact Syncing across all Apps)

Loft47 connects with many other systems you use in your business everyday. Because we hold accounting records it is important that we do our very best not to duplicate contacts between systems. In order to do that we’ve developed a very sophisticated contact matching algorithm. 
When attempting to match contacts we first look at the contacts email.  Any email addresses that are shared between two contacts will generate an exact match between two systems. If an email is populated in a contact record then an exact match of the email is required to consider them matched.  If there is no email or duplicate contacts with the same email we apply our matching algorithm. 


Lofts contact matching algorithm calculates the similarity between two contacts based on sequences of three characters by comparing groups of 3 characters and counting matches.  Two records are considered a match when 60% or more of those characters or sequences (strings) match.

Matching Algorithm Process

Preprocessing

The input strings are preprocessed to remove any leading or trailing spaces, and are converted to lowercase for case-insensitive comparison.

Trigram Extraction

The preprocessed strings are then divided into trigrams. Trigrams are generated by taking each consecutive set of three characters from the string, including spaces if present. For example, the trigrams of the string "example" would be "exa", "xam", "amp", "mpl", "ple".

Trigram Matching

The trigrams of the two input strings are compared to find the common trigrams. The number of common trigrams is counted, and this count is used as a measure of similarity.

Similarity Calculation

The similarity between the two strings is calculated using the Jaccard similarity coefficient, which is defined as the ratio of the number of common trigrams to the total number of unique trigrams in both strings. The formula for calculating Jaccard similarity is: Jaccard similarity = (Number of common trigrams) / (Total number of unique trigrams)

Scoring

The Jaccard similarity coefficient is then multiplied by 100 to get a similarity score as a percentage, with 100% indicating a perfect match and 0% indicating no similarity.

Example of Matching Algorithm

Here's an example of how two words, "example" and "samples", are scored using the trigram algorithm:

Preprocessing

The input words are converted to lowercase and trimmed of leading/trailing spaces: "example" and "samples".

Trigram Extraction

Trigrams are generated for both words:
For "example": "exa", "xam", "amp", "mpl", "ple"
For "samples": "sam", "amp", "mpl", "ple", "les"

Trigram Matching

Common trigrams between the two words are: "amp", "mpl", "ple".

Similarity Calculation

The number of common trigrams is 3, and the total number of unique trigrams in both words is 5. So, the Jaccard similarity coefficient is 3/5 = 0.6 or 60%.

Scoring

The similarity score between "example" and "samples" is 60% using the trigram similarity algorithm.



    • Related Articles

    • Xero Contact Syncing

      How profiles in Loft sync to Xero contacts and when When any transaction is posted Loft looks at the contact type and the existing Xero Contact.  If the Contact does not exist in Xero, Loft will automatically create the contact in Xero and then link ...
    • QuickBooks Online Contact Mapping

      When any transaction is posted we will look at profiles and the contact associated with a transaction and look for an existing QuickBooks Online Contact.  When the Contact does not exist in QuickBooks the contact is automatically created and then an ...
    • Creating a New deal as an Agent

      To create a new deal in Loft click New Deal in the menu on the left. Make sure to fill in all of the required fields (marked with *) and complete all of the steps below!  Fill out as much as you can, but don't worry if you don't fill all the fields ...
    • Contact types explained

      Internal contact types  These contacts you use for internal use: Admin - this type can have full or office access to brokerage menus, deals, reports, etc.  You would assign your admin or conveyancer to this profile type and then reach out to us to ...
    • Updates and new features released for January, 2017.

      Happy New Year!  Loft has made updates and launched some new features. Many of the items on this list were specifically requested by you so please keep the suggestions and feedback coming! THE ACTIONABLE DASHBOARD Your dashboard just got a whole lot ...