Git Product home page Git Product logo

document_similarity's Introduction

Document_Similarity

Document similarity measures are very important in the field of information retrieval and search engines. They are measures that tell us how similar to documents are in terms of their word content. They can be used to find similar documents or to find how close a document is to a query on a search engine. There are many of such measures.

In this program, I developed a StringSet class that stores a set of C++ strings

  • This class contains the following:

    • A constructor that takes a file name and loads the words in it (ignoring punctuation and turning text to lower case).
    • A constructor that takes a string and loads it
    • Functions to add a string to the set, remove a string from the set, clear the entire set, return the number of strings in the set, and output all strings in the set.
    • The + operator overloaded to return the union of two StringSet objects.
    • The '*' operator overloaded to return the intersection of two StringSet objects.
    • A function to compute the similarity between the current StringSet and an input parameter of type StringSet.
  • Similarity is measured by binary cosine coefficient. The coefficient is a value between 0 and 1, where 1 indicates that the query (or document) is very similar to the document and 0 indicates that the query has no keywords in common with the document.

  • Once we have a query Q represented as a set of words and a document D represented as a set of words (each word counts once even if repeated in document multiple times), the similarity between Q and D is computed by:

    • Sim = |Q โˆฉ D| The size of set of common words / (sqrt size of D * sqrt size of Q)

document_similarity's People

Contributors

mayazayn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.