Giter Club home page Giter Club logo

fastlookup's Introduction

Fastlookup

Google instant like autocompletion for a 200000+ words dataset using suffix tree,

Demo

Preview

Backend

App provides an api endpoint at 0.0.0.0:8000/search?word=< word to match> It returns top 25 matching results e.g 0.0.0.0:8000/search?word=proc will return 25 results matching proc according to conditions given below

Ranking

Words are ranked as follows

1.Matches can occur anywhere in the string, not just at the beginning. For example, eryx should match archaeopteryx (among others).

  1. The ranking of results should satisfy the following: a. We assume that the user is typing the beginning of the word. Thus, matches at the start of a word should be ranked higher. For example, for the input pract, the result practical should be ranked higher than impractical. b. Common words (those with a higher usage count) should rank higher than rare words. c. Short words should rank higher than long words. For example, given the input environ, the result environment should rank higher than environmentalism.

  2. As a corollary to the above, an exact match should always be ranked as the first result.

Warning

Project uses unoptimised version of Suffix-Tree, hence data in memory gets really large. You can modify the MAX variable in fastlookup/fastlookup/backend/constants.py to how much of the words you want to include, Since this program is resource heavy, if you have <4GB RAM keep it <200000, otherwise you system may hang

A computer with 8GB Ram is IDEAL for this project

Requirement

python3.6 minimum 4GB RAM pipenv

Usage

python3.6 -m pip install pipenv
git clone https://github.com/mahto56/fastlookup.git
cd fastlookup/
pipenv install
pipenv shell
cd fastlookup
python manage.py runserver 0.0.0.0:8000

Goto 0.0.0.0:8000

or

Goto 0.0.0.0:8000/search?word=proc

fastlookup's People

Contributors

mhtocs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.