Giter VIP home page Giter VIP logo

vector-text-similarity-search's Introduction

Vector text similarity search

Search for similar documents using Elasticsearch and BERT.
This assumes Japanese sentences.

Requirement

  • docker-compose

Usage

$ docker-compose up --build

Init

  1. Download and set up the model file

Download from here.

Rename download files like this.

$ ls bertserver/model
bert_config.json			bert_model.ckpt.meta			wiki-ja.model
bert_model.ckpt.data-00000-of-00001	graph.pbtxt				wiki-ja.vocab
bert_model.ckpt.index			vocab.txt
  1. Go to JupyterLab(http://0.0.0.0:8888/lab) and open terminal

  2. Create Elasticsearch index

$ python create_index.py --index_file index.json --index_name vector_search
  1. Create Elasticsearch documents
$ python create_documents.py --data contents.csv --save contents.json --index_name vector_search
  1. Index Elasticsearch documents
$ python index_document.py --data contents.json
  1. Open main.ipynb and run

Hints

Expected data format

csv and japanese are expected.

content
私は仕事中によく居眠りをしてしまいます。眠気を覚ます方法を教えて下さい。

content can be multiple sentences.
It is split into one sentence during preprocessing

Reference

vector-text-similarity-search's People

Contributors

dependabot[bot] avatar doarakko avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

nlgrf

vector-text-similarity-search's Issues

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.