A simhash algorithm for the analysis of similar text documents

Source: Internet
Author: User

Simhash algorithm:

The input to the Simhash algorithm is a vector, and the output is an F-bit signature value. For the sake of presentation, it is assumed that the input is a set of features of a document, each with a certain weight. For example, a feature can be a word in a document, and its weight can be the number of times the word appears. The Simhash algorithm is as follows:
1, an F-dimensional vector V is initialized to 0, and the F-bit binary number S is initialized to 0;
2, for each feature: using the traditional hash algorithm to generate an F-bit signature B for this feature. For I=1 to F: if the bit I of B is 1, then the element I of V is weighted with the feature, otherwise, the I element of V subtracts the weight of the feature.
3, if the first element of V is greater than 0, then the first bit of S is 1, otherwise 0;
4, output S as signature.

A simhash algorithm for the analysis of similar text documents

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.