javaxmlfuzzy-logicrecord-linkageduke

Duke deduplication engine: linking records not working?


I am attempting to use Duke to match records from one database to another. One db has song titles + writers. I am trying to match to another db to find duplicates and corresponding records.

I have gotten duke to run and I can see some of the records getting matched. But no matter what I do, Correct links found = 0% always and I just cant right to the linkfile.

This is what I have done currently:

<duke>
<schema>
    <threshold>0.79</threshold>
    <maybe-threshold>0.70</maybe-threshold>
    <path>test</path>

    <property type="id">
        <name>PublishingID</name>
    </property>

    <property type="id">
        <name>AmgID</name>
    </property>

    <property>
        <name>NAME</name> 
        <comparator>no.priv.garshol.duke.comparators.JaroWinkler</comparator>
        <low>0.12</low>
        <high>0.61</high>
    </property>
    <property>
        <name>TITLE</name> 
        <comparator>no.priv.garshol.duke.comparators.Levenshtein</comparator>
        <low>0.09</low>
        <high>0.93</high>
    </property>
</schema>

<group>
    <jdbc>
        <param name="driver-class" value="com.mysql.jdbc.Driver"/>
        <param name="connection-string" value="jdbc:mysql://127.0.0.1"/>
        <param name="user-name" value="root"/>
        <param name="password" value="root"/>
        <param name="query" value="
            SELECT pSongs.song_id, pSongs.songtitle, pSongs.publisher_id, pWriters.first_name AS writer_first_name, pWriters.last_name AS writer_last_name 
            FROM    devel_matching.publisher_songs AS pSongs
            INNER JOIN devel_matching.publisher_writers as pWriters ON pWriters.publisher_id = pSongs.publisher_id AND pWriters.song_id = pSongs.song_id
            WHERE pSongs.writers LIKE '%LENNON, JOHN%'
            LIMIT 20000;"/>
        <column name="song_id" property="PublishingID"/>
        <column name="songtitle" property="TITLE" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
        <column name="writer_first_name" property="NAME" cleaner = "no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
    </jdbc>
</group>

<group>
    <jdbc>
        <param name="driver-class" value="com.mysql.jdbc.Driver"/>
        <param name="connection-string" value="jdbc:mysql://127.0.0.1"/>
        <param name="user-name" value="root"/>
        <param name="password" value="root"/>
        <param name="query" value="
            SELECT amgSong.id, amgSong.track, SUBSTRING_INDEX(SUBSTRING_INDEX(amgSong.composer, '/', numbers.n), '/', -1) composer
            FROM 
                devel_matching.numbers INNER JOIN devel_matching.track as amgSong
                ON CHAR_LENGTH(amgSong.composer) - CHAR_LENGTH(REPLACE(amgSong.composer, '/', '')) >= numbers.n - 1
            WHERE amgSong.composer like '%lennon%'
            LIMIT 5000;"/>
        <column name="id" property = "AmgID"/>
        <column name="track" property="TITLE" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
        <column name="composer" property="NAME" cleaner = "no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
    </jdbc>
</group>

Output:

Running on Spring STS: program arguments = --progress --verbose --testfile=linked.txt --testdebug --showmatches duke.xml

Its not writing to linked.txt or finding any correct links. Not sure what I am doing wrong here. Any help would be awesome.


Solution

  • Actually, it is finding 8284 links. --testfile is for giving Duke a file containing known correct links, basically test data. What you want is --linkfile, which writes the links you've found into that file.

    I guess I should add code which warns against an empty test file, since that very likely indicates a user error.

    You'd probably be better off asking this question on the Duke mailing list, btw.