我有:100万个大学生姓名和300万个银行客户姓名
我设法将字符串转换为基于散列的数值(相似的字符串具有相似的散列值)。我想知道如何确定这两个集合之间的相关性,以查看值是否至少匹配了60%?
我可以使用ICC来实现这一点吗?ICC双向随机是如何工作的?
请尽快答复,因为我急需这个。
发布于 2011-03-27 05:26:59
这种实体解析等通常很容易,但我对这里的散列方法感到惊讶。散列会丢失对实体解析至关重要的信息。所以,如果可能的话,你不应该使用hash,而应该使用原始字符串。
假设使用原始字符串是一种选择,那么您可能想要这样做:
列表A (1M)、列表B (3M)
// First, match the entities that match very well, and REMOVE them.
for a in List A
for b in List B
if compare(a,b) >= MATCH_THRESHOLD // This may be 90% etc
add (a,b) to matchedList
remove a from List A
remove b from List B
// Now, match the entities that match well, and run bipartite matching
// Bipartite matching is required because each entity can match "acceptably well"
// with more than one entity on the other side
for a in List A
for b in List B
compute compare(a,b)
set edge(a,b) = compare(a,b)
If compare(a,b) < THRESHOLD // This seems to be 60%
set edge(a,b) = 0
// Now, run bipartite matcher and take results
该算法的时间复杂度为O(n1 * n2),不是很好。有一些方法可以避免这种成本,但它们取决于您特定的实体解析函数。例如,如果姓氏必须匹配(以达到60%的削减),那么您可以简单地在A和B中创建由姓氏的前几个字符划分的子列表,并在相应的列表之间运行此算法。但是很可能姓氏"Nuth“应该与"Knuth”匹配,等等。因此,一些关于你的名字比较功能的本地知识可以帮助你更好地划分和克服这个问题。
https://stackoverflow.com/questions/5199602
复制相似问题