[SimHash] find the percentage of similarity between two given data
SimHash algorithm, introduced by Charikarand is patented by Google.
Simhash 5 steps: Tokenize, Hash, Weigh Values, Merge, Dimensionality Reduction
tokenize
tokenize your data, assign weights to each token, weights and tokenize function are depend on your business
hash (md5, SHA1)
calculate token's hash value and convert it to binary (101011 )
weigh values
for each hash value, do hash*w, in this way: (101011 ) -> (w,-w,w,-w,w,w)
merge
add up tokens' values, to merge to 1 hash, for example, merge (4 -4 -4 4 -4 4) and (5 -5 5 -5 5 5) , results to (4+5 -4+-5 -4+5 4+-5 -4+5 4+5),which is (9 -9 1 -1 1)
Dimensionality Reduction
Finally, signs of elements of
Vcorresponds to the bits of the final fingerprint, for example (9 -9 1 -1 1) -> (1 0 1 0 1), we get 10101 as the fingerprint.
How to use SimHash fingerprints?
Hamming distance can be used to find the similarity between two given data, calculate the Hamming distance between 2 fingerprints.
Based on my experience, for 64 bit SimHash values, with elaborate weight values, distance of similar data
often differ appreciably in magnitude from those unsimilar data.
how to calculate:XOR, 只有两个位不同时结果是1 ,否则为0,两个二进制value“异或”后得到1的个数 为海明距离 。

simhash 0.1.0 : Python Package Index
[SimHash] find the percentage of similarity between two given data的更多相关文章
- [SimHash] the Hash-based Similarity Detection Algorithm
The current information explosion has resulted in an increasing number of applications that need to ...
- 21个常用的PHP代码汇总
PHP 是目前使用最广泛的基于 Web 的编程语言,驱动着数以百万计的网站,其中也包括如 Facebook 等一些大型站点.这里收集了 21个日常开发中实用便捷的 PHP 代码,希望可以对一些 PHP ...
- maker 2008年发表在genome Res
http://gmod.org/wiki/MAKER_Tutorial 简单好用 identify repeats, to align ESTs and proteins to the genome, ...
- git diff 理解
0. 理解 git diff 返回信息 1. 命令 $ git diff README.md 2. 返回信息,注解 diff --git a/README.md b/README.md ## 1. 表 ...
- 21 段实用便捷的 PHP 代码
PHP 是目前使用最广泛的基于 Web 的编程语言,驱动着数以百万计的网站,其中也包括如 Facebook 等一些大型站点.这里收集了 21 段实用便捷的 PHP 代码摘录,对每种类型的 PHP 开发 ...
- 21个实用便利的PHP代码
转载请注明来源:https://www.cnblogs.com/hookjc/ 1. PHP可阅读随机字符串 此代码将创建一个可阅读的字符串,使其更接近词典中的单词,实用且具有密码验证功能. /*** ...
- jQuery插件之simplemodal
1.simplemodal在内部定义了如下css类 simplemodal-overlay:遮罩 simplemodal-container:弹出窗口容器 simplemodal-wrap simpl ...
- libuv里的几个缺陷
libuv是node.js使用的基础库,主要包括主循环,文件和网络接口.虽然libuv是为node.js而生的,但它本身是一个独立的库,加上使用简单方便,所以在node.js之外也有不少人使用.最近整 ...
- windows 下使用 zip安装包安装MySQL 5.7
以下内容参考官方文档:http://dev.mysql.com/doc/refman/5.7/en/windows-start-command-line.html 解压缩zip到D:\mysql-5. ...
随机推荐
- TreeMap 的实现
TreeMap 的实现就是红黑树数据结构,也就说是一棵自平衡的排序二叉树,这样就可以保证当需要快速检索指定节点. TreeSet 和 TreeMap 的关系 为了让大家了解 TreeMap 和 Tre ...
- js对象的深度克隆
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- PreparedStatement
PreparedStatement > 它是Statement接口的子接口: >强大之处: 防SQL攻击: 提高代码的可读性.可维护性: 提高效率! l 学习PreparedStateme ...
- NGUI如何使2D图片按像素1:1显示在屏幕上
NGUI版本为3.5.1. 将camera 设置为正交模式,size值设为1. UIRoot(2D)有3种缩放样式: 1.PixelPerfect.UI严格按照指定的像素大小显示,不会随着屏幕的分辨率 ...
- zookeeper+dubbo-admin开发dubbo应用
前面的章节中我们已经安装好了zookeeper,tomcat了.今天我们来实现一个完整的从dubbo消息产生到消费的完整流程. 1.dubbo api 2.dubbo consumer 消费者 3.d ...
- MYSQL单双向同步
Master:192.168.1.101 Slave :192.168.1.102 单向同步(一) 进入Master启动MYSQL [root@localhost ~]# service mysql ...
- Github上有趣的资料 | JS
留着,以后用得着,原文地址:http://www.jianshu.com/p/7c9aa9508641 collection AlloyImage 基于HTML5的专业级图像处理开源引擎.An ima ...
- 使用 IDEA + Maven + Git 快速开发 JAVA或者Web 应用(转)
0-0 前言 最近和同事做爬虫,其中我主要遇到的问题是:同事在github上放了爬虫demo让我自己去下载,然后自己能搭好环境让整个项目跑起来去抓51job找工作数据.git上克隆一个项目下来,项目是 ...
- C# treeview 绑定数据 【转】
private void bindTreeView1() { string sql = "select * from dm_category"; DataTable dt = db ...
- Android环境虚拟WINDOWS系统
参考文档:http://bbs.anzhi.com/thread-5120526-1-1.html 我们知道安卓手机是arm平台,windows是x86平台,指令集完全不同,但在这里要教给大家的是靠软 ...