2
我正在嘗試使用杜克匹配記錄從一個CSV到另一個。第一個CSV和第二個都有ID,Model,Price,CompanyName,Review,Url
列。我正在嘗試與另一個csv匹配來查找重複記錄。杜克重複數據刪除引擎:完全相同的記錄不匹配
package no.priv.garshol.duke;
import no.priv.garshol.duke.matchers.PrintMatchListener;
public class RunDuke {
public static void main(String[] argv) throws Exception {
Configuration config =
ConfigLoader
.load("/home/kishore/Duke-master/doc/example-data/presonalCare.xml");
Processor proc = new Processor(config);
proc.addMatchListener(new PrintMatchListener(true, true, true, false, config.getProperties(),
true));
proc.link();
proc.close();
}
}
這裏是personalCare.xml
一個例子:
<!-- language: xml -->
<!-- For more information, see https://github.com/larsga/Duke/wiki/ Improvements
needed: - some area numbers have spaces in them - not stripping accents from
names -->
<duke>
<schema>
<threshold>0.7</threshold>
<property type="id">
<name>ID</name>
</property>
<property>
<name>Model</name>
<comparator>no.priv.garshol.duke.comparators.Levenshtein</comparator>
<low>0.4</low>
<high>0.8</high>
</property>
<property>
<name>Price</name>
<comparator>no.priv.garshol.duke.comparators.ExactComparator</comparator>
<low>0.04</low>
<high>0.73</high>
</property>
<property>
<name>CompanyName</name>
<comparator>no.priv.garshol.duke.comparators.Levenshtein</comparator>
<low>0.4</low>
<high>0.8</high>
</property>
<property>
<name>Review</name>
<comparator>no.priv.garshol.duke.comparators.Levenshtein</comparator>
<low>0.12</low>
<high>0.93</high>
</property>
<property>
<name>Url</name>
<comparator>no.priv.garshol.duke.comparators.Levenshtein</comparator>
<low>0.12</low>
<high>0.93</high>
</property>
</schema>
<database class="no.priv.garshol.duke.databases.InMemoryDatabase">
</database>
<group>
<csv>
<param name="input-file" value="personal_care_11.csv" />
<param name="header-line" value="false" />
<column name="1" property="ID" />
<column name="2" property="Model" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="3" property="Price" />
<column name="4" property="CompanyName" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="5" property="Review" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="6" property="Url" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
</csv>
</group>
<group>
<csv>
<param name="input-file" value="personal_care_11.csv" />
<param name="header-line" value="false" />
<column name="1" property="ID" />
<column name="2" property="Model" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="3" property="Price" />
<column name="4" property="CompanyName" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="5" property="Review" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
<column name="6" property="Url" cleaner="no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"/>
</csv>
</group>
</duke>
上面的代碼工作正常,但它不匹配的確切記錄例如
STHDRNFKAQ4AFYE8,Littmann 3M Classic II S.E Acoustic
Stethoscope,6297,Littmann,,http://dl.flipkart.com/dl/littmann-3m-classic-ii-s-e-acoustic-stethoscope/p/itme3uhzbqxhzfda?pid=STHDRNFKAQFAFYE8&affid=3ba0de4902524e2b90e43b84b89ea0ef
這兩個CSV文件。我也想知道.xml
文件中給出的低和高屬性值的工作,如何確定列值的低和高值。
謝謝你的答覆。我想知道所有欄目的財產概率低和高的意義。我該如何決定。當我給出較高的參數像0.5這樣的較小值時,它給出的結果比0.8更準確。我得到這個。請幫幫我。 –
低概率=值不匹配的概率。高=匹配時的概率。 – larsga