[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. ...
随机推荐
- jquery mobile上传图片完整例子(包含ios图片横向问题处理和C#后台图片压缩)
上传图片本身是个基本的小功能,但是到了移动端就不那么简单了,相信找到这篇文章的你一定有深深的同感. 本文实例是:在(移动端)页面中点击图片,然后选择文件,然后保存.使用Asp.net 难点一:后台获取 ...
- jquery如何根据text选择option
百度出来的代码都是这样的: $('#test option[text="b"]').attr("selected",true); 或 $('#test').fi ...
- MVC WebAPI中响应客户端请求返回图片
// GET api/values public HttpResponseMessage Get() { Image img = GetImage(); MemoryStream ms ...
- NC台网震相走时获取及 HYPOINVERSE 格式读取
HYPOINVERSE格式介绍:http://www.ncedc.org/ftp/pub/doc/man5/ncsn.phase.5 获取网站: http://www.ncedc.org/ncedc/ ...
- Python开发入门与实战15-IIS部署
15. IIS部署 前面的章节我们完成了基本的业务功能的开发,本章节我们来说说python django项目如何部署到实际的运行环境,完成开发系统的发布工作. Python Django 项目部署发布 ...
- php7.0支持调用lua脚本
需求前瞻: 最近因需求,需要支持php调用现有的Lua代码,可以减少php的代码量,同时在维护上也比较方便,不会照成需求变更,需要同时修改两份代码 第一步:安装php7.0及以上版本,此处安装方法就略 ...
- [解决方案] pythonchallenge level 4
http://www.pythonchallenge.com/pc/def/linkedlist.php 查看页面源代码或者点击图片 http://www.pythonchallenge.com/pc ...
- Android系统启动过程
首先Android框架架构图: Linux内核启动之后就到Android Init进程,进而启动Android相关的服务和应用. 启动的过程如下图所示:(图片来自网上,后面有地址) 下面将从And ...
- Uncaught ReferenceError: WebForm_DoPostBackWithOptions is not defined
环境:Asp.Net网站,Framework版本4.0,IIS版本7.0问题:按钮失效,下面是按钮代码: <a id="dnn_ctr1161_Login_Login_DNN_cmdL ...
- Android中通过注解代替findViewById方法
转自:http://www.2cto.com/kf/201405/302998.html 这篇文章主要讲解注解实现findViewById的功能,首先我们来熟悉一下在java中怎么定义一个注解和解析一 ...