Giter Site home page Giter Site logo

-demo's Introduction

用elasticsearch搭建简易的语义搜索引擎

核心的代码在4个python文件中,其它的文件都是网站代码,或者数据文件,可以忽视

preprocess.py

将实验的数据集转换为json格式,同时做一些预处理。处理后,一个实体及其所关联的所有属性和属性值存储为一个json对象,作为将导入elasticsearch的一个文档

build_dict.py

构建数据集中属性名字典和实体名字典,用于在解析查询时判断查询语句是否包含知识库中的属性或实体。在数据集较小的时候可以这样做,在数据集较大的时候可以通过检索elasticsearch来判断

insert.py

将处理好的数据导入elasticsearch, 需为elasticsearch新建index和type(这个没有写成代码,在命令行完成)

search/views.py

核心代码,包括用户查询解析,elasticsearch查询构造。

-demo's People

Contributors

notwice1 avatar thwice avatar

Watchers

 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.