Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

simple simhashing in hadoop with cascading

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 resources
Octocat-spinner-32 src
Octocat-spinner-32 test-resources
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.mkd
Octocat-spinner-32 project.clj
README.mkd

cascading-simhash

Say you have a large corpus of web documents and you want to group them together by some notion of "similarity". For instance, we may want to detect plagiarism or find content that appears on multiple places on a site. In this scenario it is impractical to do a pairwise comparison of all documents. Fortunately, we can use simhashing.

Broadly speaking, simhashing is a algorithm that calculates a "group id" (the minimum hash, or minhash) from the content. Because the minhash for an item is calculated independently of the other items in the set, minhashing is an ideal candidate for MapReduce.

Dependencies

leiningen

[cascading-simhash "1.0.0-SNAPSHOT"]

maven

<dependency>
  <groupId>cascading-simhash</groupId>
  <artifactId>cascading-simhash</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</dependency>

Running the Java Example

Take a look at src/java/simhash/examples/SimpleSimhash.java for an example of how to use this package from java.

lein uberjar
lein classpath > classpath
java -cp `cat classpath`:build/cascading-simhash-1.0.0-SNAPSHOT-standalone.jar simhash.examples.SimpleSimhash "test-resources/test-documents.txt"

Running the Clojure Example

See: src/clj/simhash/examples/bigrams.clj

lein compile lein run -m simhash.examples.bigrams test-resources/test-documents.txt

Author

Nate Murray 2011

License

Copyright 2010 Nate Murray

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
Something went wrong with that request. Please try again.