Git Product home page Git Product logo

sevvalmehder / tiny-search-engine Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 812 KB

Simple search system that includes inverted index builder and boolean query processor for information retrieval.

Python 100.00%
search search-engine boolean-retrieval boolean-query boolean-query-parser inverted-index inverted-index-implementation inverted-indexing inverted-index-model query-processor query-processing

tiny-search-engine's Introduction

simple-search-system

Simple search system that includes inverted index builder and boolean query processor for information retrieval.

Usage

This program uses Reuters-21578 Dataset. Please place the dataset before build inverted index.
Also do not forget to add stopwords in stopwords.txt file.

The file tree must be like this:

├── dictionary.pkl (not necessary) ├── main.py ├── README.md ├── reuters21578 │   ├── lewis.dtd │   ├── README.txt │   ├── reut2-000.sgm │   ├── reut2-001.sgm │   ├── ... │   └── reut2-021.sgm ├── src │   ├── base.py │   ├── inverted_intex.py │   ├── query_processor.py │   └── sgm_preprocessor.py └── stopwords.txt

Run

Programs run with python main.py command. Program gets input query and print result until q is given.

Examples

4 different query types are implemented:

  1. Conjunction: w1 AND w2 AND w3...AND wn
    example: oil AND agriculture AND vegetable
    result: [3950, 5655, 7625, 8003, 9550, 9756, 10720, 14509, 15341, 18403, 20232]
  2. Disjunction: w1 OR w2 OR w3...OR wn
    example: hate OR love OR cry
    result: 1895, 3148, 6338, 7366, 8827, 10890, 17099, 17903, 19559]
  3. Conjunction and Negation: w1 AND w2...AND wn NOT wn+1 NOT wn+2 ...NOT wn+m
    example: oil AND agriculture AND vegetable NOT price
    result: [3950, 5655, 7625, 8003, 9550, 9756, 10720, 14509, 15341, 20232]
  4. Disjunction and Negation: w1 OR w2...OR wn NOT wn+1 NOT wn+2 ...NOT wn+m
    example: hate OR love OR cry NOT money NOT price
    result: [1895, 3148, 6338, 7366, 8827, 10890, 17099]

tiny-search-engine's People

Contributors

sevvalmehder avatar sevvalnoob avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

cuiweifu

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.