Giter Site home page Giter Site logo

insearch's Introduction

InSearch

📚 Introduce

전문 검색을 지원하는 파이썬 기반 역색인 구조 라이브러리

  • 형태소 분석기 : 은전한잎
  • 검색 알고리즘 : BM25 알고리즘 구현

Python-based inverted index structure library with full-text search support

  • Morphology Analyzer : eunjeon
  • Algorithm of Search : BM25

🤝 Team

2ternal fortune00
[email protected] [email protected]
dev. BM25 & Analyzer dev. main function

🔧 Installation

pip install InSearch
  • Recent release version : 0.1.4

🍏 Using

Initalize

import InSearch as IS

docs = ["동해물과 백두산이 마르고 닳도록 하느님이 보우하사 우리나라 만세 무궁화 삼천리 화려 강산 대한 사람 대한으로 길이 보전하세",
        "남산 위에 저 소나무 철갑을 두른 듯 바람 서리 불변함은 우리 기상일세 무궁화 삼천리 화려 강산 대한 사람 대한으로 길이 보전하세",
        "가을 하늘 공활한데 높고 구름 없이 밝은 달은 우리 가슴 일편단심일세 무궁화 삼천리 화려 강산 대한 사람 대한으로 길이 보전하세",
        "이 기상과 이 맘으로 충성을 다하여 괴로우나 즐거우나 나라 사랑하세 무궁화 삼천리 화려 강산 대한 사람 대한으로 길이 보전하세"]


insearch = IS.InSearch()
for doc_id, doc_content in enumerate(docs):
    insearch.add_document(doc_id, doc_content)

Search with full-text

query = "구름과 달"

insearch.get_scores(query)
# [(0.6978270940070869, 0), (2.4242033059345935, 2), (0.6794766371887851, 3)]

insearch.search(query)
# [2, 0, 3]

More about Document

# update
insearch.update_document(doc_id, doc_content)

# delete
insearch.delete_document(doc_id)

More about Table

# get table
insearch.return_table()

# get size of table 
insearch.get_size()

# initialize table 
insearch.delete_all()

More about Search

# search top n
insearch.search_top_n()

🕸 Web for Test

CNUCSE-Team2의 InSearch-web를 통해 해당 라이브러리 작동을 확인할 수 있어요!

insearch's People

Contributors

2ternal avatar sinyoung3016 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.