Various fuzzy string match algorithms & Excellent video review

Fuzzy String Match

I’ve been studying up on fuzzy string match after controlling for misspellings, typos, dyslexia etc.  and I found a few articles discussing various approaches like:

Levenstein distance
Damerau–Levenshtein distance
n-gram
Soundex
Jaro-Winkler distance
Jaccard index

I found this video from two guys which took a process of checking to see if a name was on a terrorist watch lists which originally took 14 days to compute down to 5 minutes
What’s in a Name? Fast Fuzzy String Matching – Seth Verrinder & Kyle Putnam – Midwest.io 2015

Below are my notes from watching the fuzzy string match video (it is ~40 minutes long but very interesting)

1) throw more hardware
2) use another variable/field (zip code / country etc.)
3) n-grams
4) metric trees (example: Lowenstein distance)
5) Brute force (Jaro Winkler is pretty fast already) (5X down to 70hrs )
6) Filtering- estimate similarity first then filter (7x down to 50 hrs 18 minutes in video)
· Length of strings (name length often is not normally distributed so doesn’t rule out too much) Probably still look at 70%
· 26 Character filter- search for character that isn’t shared- This dropped out quite a bit but was slow (300x down to 65 minutes)
o Bitmap filter- use bitwise operations to get unmatched count- very fast! (340X down to 60 minutes 20 minutes in video)
o 64 character filter (used all bits)- checked for multiple occurrences of a given letter

7) Minimize recalculation (4,000x down to 5 minutes – 28 minutes in video)
· sort names and groups into segments
· common length and first character
· used WolframAlpha to help show formula

Learnings from Fuzzy String Match process

· Measure performance and focus on bottleneck
· Order of magnitude doesn’t always tell you about actual performance
· Favor simplicity

Approximate text matching – Wikipedia, the free encyclopedia

In computer science, approximate string matching (often colloquially referred to as fuzzy string searching) is the technique of finding strings that match a pattern …

kiyoka/fuzzy-text-match · GitHub

fuzzy string match library for ruby. Contribute to text-match development by creating an account on GitHub.

text-match | RubyGems.org | your community gem host

text-match 0.9.7. calculate Jaro Winkler distance. Versions: 0.9.7 – December 21, 2013 (13.5 KB); 0.9.6 – December 21, 2013 (13.5 KB); 0.9.5 – March 26, …

Remove duplicates from CSV files in a flash with an AutoHotKey script

Remove-DuplicatesIn email marketing I am frequently having to remove duplicates.   I typically used Excel for this but I did it so frequently I built a small script to automate the process.

The program requires a CSV file and utilizes Microsoft’s Component Object Model to open Excel and examine the headers for a field named “email”.  Once it finds it it removes duplicate email addresses and saves them as a new file in the same folder with the naming showing how many rows are present.   This greatly reduces the amount of work needed to do the job.
This should ease the removal of duplicates from CSV files.

Remove duplicates demo video

(Regular Expressions) RegEx to clean text | Mind-blowing ways to clean up your text!

RegEx to clean text

RegEx to Clean Text

I used to work in Market Research and would spend hours cleaning up labels from surveys I’d programmed in online tools. The below video shows how easy it can be if you understand regular expressions and a little programming.

Regular Expressions can have a steep learning curve however it is really worth it if you continually get data that you need to clean.  You can also check out this post of mine showing how they can be used to automate your metrics.

RegEx to clean text demo

A handy cheat-sheet is downloadable from here and a wonderful course from Kevin Skoglund available from Lynda.com is available here.  Below is a great intro to the Regular Expressions.

https://www.youtube.com/watch?v=CvBKX_UYslQ

Regex to clean text in preparation for word count in PHP – Code …

Jan 25, 2014 … … a question; Anybody can answer; The best answers are voted up and rise to the top. Regex to clean string in preparation for word count in PHP …

php – Match all youtube links in a string of text – Code Review Stack …

Apr 7, 2015 … Regular expressions to clean text in preparation for word count in PHP · 0 · Remove parameters from string containing URL · 4 · Normalizing strings using …

php – Regex to remove inline javascript from string – Code Review …

Aug 21, 2013 … Regex to clean text in preparation for word count in PHP · 2 · Regex-ing an array · 2 · Removing stray brackets from in between shortcodes.