Code Monkey home page Code Monkey logo

rakshithshetty / simsearch-text Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 392 KB

This code implements fast cosine similarity search between text sentences. You have a database of sentences (can be tweets/ documents etc ) and a list of query sentences. This code searches the database and finds the nearest neighbhor to the given queries using cosine similarity. The code supports 1) brute force search 2) Fast exact search by building smart indexes 3) Fast approximate search (given the error tolerance) . It is written in C language and you just need basic c compiler to use the code. It has been tested on linux 64 bit machines

License: BSD 2-Clause "Simplified" License

MATLAB 8.28% C 75.16% Shell 15.38% Makefile 1.17%
cosine-similarity tweets sentence-similarity nearest-neighbor-search

simsearch-text's Introduction

SimSearch-text

This code implements fast cosine similarity search to find the nearest neighbor to a query sentence in a database. Input is a database of sentences (can be tweets/ comments etc ) and a list of query sentences. This code searches the database and finds the nearest neighbhor to the given queries using cosine similarity (Similar to Jaccard similarity). The code implements:

  1. brute force search
  2. Fast exact search by building smart indexes
  3. Fast approximate search (given the error tolerance).

It is written in C language and you just need basic c compiler to use the code. It has been tested on linux 64 bit machines.

Fast search methods need to first build indexes on the database, which help speed up the search.

For a database of 14 million tweets and 1000 queries fast exact search takes about 160 seconds to search the nearest neighbour while Approximate search takes about 90 seconds. (Both times don't take into account index building phase which can take pretty long but is a one time thing).

Read the report.pdf for more technical details and read the README in src directory for usage instruction. Best place to start is with the master_deploy.sh script.

simsearch-text's People

Contributors

rakshithshetty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

himanshurepo

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.