Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I had a similar issue when I set up a web site that consolidates music charts from around the world. In my case I wanted to match names of artists and titles of songs, the source data tended to have challenges ranging from the simple ("Beatles" v "The Beatles" and "Gary Crosby" v "Gary Crosby and his Orchestra") to the really quite complex ("Paul McCartney" v "Wings").

I have used a modified Levenshtein distance algorithm on strings that have been Soundex-ed, which was then tuned so that processing the 279,524 entries currently takes 4 or so hours on a reasonable machine.

You have to match the processing you are doing with the types of mistakes in your data. For names this will be spelling mistakes (so when matching names you must preprocess them with something like Soundex). For titles I would guess that, like my song titles, the words tend to be spelt correctly but you get them in different orders, you get issues like:

  • "Que sera sera (Whatever will be will be)" v "Whatever will be will be (Que sera sera)"
  • "Do What U Gotta Do" v "Do What You've Got to Do"
  • "Maybe It's Because" v "Maybe its because"
  • "Aint it Funny" v "Ain't it funny (Pettibone Remix)"
  • "Jazz-A-Samba... Part 1" v "Jazz A Samba"
  • "Would'ja Mind?" v "Would you Mind"

So you want to process the names to spot the type of transcription error you have got. For example I take the distinctive words independent of order and use that as a first pass check, if you can quickly spot items that don't match then the tiny minority that could match can have distances calculated with a more comprehensive algorithm. My guess would be that, as with my data, the matches are few and far between.

Finally, in my case, there are always things that just don't match and have to be processed by hand. Don't be surprised to find that, for some of the dumb things people do, you just have to fix them manually. We have a continual effort to detect matches and fix them in our source data


In reply to Re: Cluster a big bunch of strings by hawtin
in thread Cluster a big bunch of strings by citromatik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-03-28 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found