Skip to main content

局部敏感散列

项目描述

高雅

关于

该项目实现了用于索引和查询文本文档的局部敏感散列算法和数据结构。Gaoya 的主要用例是重复数据删除和集群。

  • 64,32,16,8 位明哈希
  • 64,128 位 simhash
  • 最小哈希 | 模拟哈希
  • 由 Rust 提供支持
  • 多线程
>>> import gaoya
>>> index = gaoya.minhash.MinHashStringIndex(hash_size=32, 
                                             jaccard_threshold=0.5, 
                                             num_bands=42, 
                                             band_size=3,
                                             num_hashes=42*3,
                                             analyzer='word', 
                                             lowercase=True, 
                                             ngram_range=(1,1))
>>> corpus = [
...     'This is the first document.',
...     'This document is the second document.',
...     'And this is the third document.',
...     'Is this the first document?',
...     'This not the first nor the second nor the third, but the fourth document'
... ]
>>> 
>>> for i, doc in enumerate(corpus): index.insert_document(i, doc)
... 
>>> index.query('This is the first document.')
[0, 1, 2, 3]
>>> 

安装

$ pip3 install gaoya

例子

使用 Gaoya 进行文档重复数据删除

参考

[1] 第 3 章,海量数据集的挖掘

[2] 舍入算法中的相似度估计技术

[3] 检测网络爬虫的近似重复项

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

内置发行版

gaoya-0.1.2-cp37-abi3-win_amd64.whl (386.4 kB 查看哈希)

已上传 cp37