Skip to main content

Jaccard similarity document manager

Project description

This package uses Jaccard similarity with bag of words to find similarities between passed in contents and a json file.

There are two useful functions:

save(filename, docID, contents) ===> takes in the json filename, an id for the document you want to save,

and the contents of the document in a string. The function adds on the docID and contents to filename, and if filename doesn’t exist, it creates a new file and inserts the passed in contents.

def getSimilarities(filename, docID, contents, threshold) ===> takes in the filename of all the documents to

to compare to, docID of the document you want to find similarities for, the contents of the document, a similarity threshold between 0 and 1 inclusive. The function returns a list of (similarity, docID) in descending order of all documents whose similarities are above or equal to the threshold.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsim-1.2.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file jsim-1.2.tar.gz.

File metadata

  • Download URL: jsim-1.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jsim-1.2.tar.gz
Algorithm Hash digest
SHA256 0740183adedd017ddab5b3693c2c2b0766146b431e42881986511abcb5fc57b1
MD5 94cd76f51fecdc5ceec52c558f29e471
BLAKE2b-256 c152a58c0d99346b8a60e5a0fafe1499bf7602198514c9e7b37d8a9974bc1712

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page