Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Fuzzy matching of text strings

by nothingmuch (Priest)
on Dec 15, 2005 at 16:03 UTC ( [id://516996]=note: print w/replies, xml ) Need Help??


in reply to Fuzzy matching of text strings

50 thousand is better than several million... If I were you my strategy would be:

  1. Normalize capitalization: lc
  2. Normalize white space: s/^\s+|\s+$//g; s/\s+/ /g
  3. Save all strings which are normalized into the same thing in a single place (tied MLDBM or in memory hash, push @{ $db{$normalized} }, $original)
  4. use Digest::Nilsimsa to hash all the keys, index using e.g. this method, as discussed in this thread (the original author may have more insight). When indexing this way, chunk the nilsimsa hash into something which will allow you to bunch items together.
  5. iterate the nilsimsa keys, and display any group of original texts whose edit distance (String::Approx) is too great. The user can then decide whether these are duplicate or not. Entries with only one item are, ofcourse, omitted.
  6. Employ a system where human categorized items are remembered, undos are easy to increase the efficiency of the human assisted process
  7. A technique like Apple's Aperture's stack feature (see the shiny publicity videos) can be used - readkey on two hotkeys, and use them to increase or decrease the tolerance of the nilsima hash difference or edit distance, in order to partition into groups easily.
  8. For each chunk of computer or human identified duplicates find the canonical version you would like to use, and insert it into the database.
-nuffin
zz zZ Z Z #!perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516996]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found