Giter VIP home page Giter VIP logo

inditex-poc's Introduction

Inditex POC

Test Dataset

  • We are using the CORD-19 (COVID-19 Open Research Dataset Challenge) dataset for testing.
  • The data used in the POC is from the ./document_parses/pdf_json folder.

Note this is a 20GB huge dataset. >100GB when unzipped. Make sure you have enough space to hold everything.

Import Test Data

Dependencies

sudo yum install -y jq cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain

Executables

The script uses mongoimport together with jq to import the json files. mongoimport is included in the MongoDB Database Tools.

Configuration

The following configuration should be replaced by yours:

  • uri='mongodb+srv://<user>:<pwd>@vectorsearchpoc.wy1z6.mongodb.net/': The target MongoDB URI.
  • db=covid: Database name where you want to store the dataset.
  • coll=paper: Collection name where you want to store the dataset.
  • json_source="<path_to_test_dataset>/document_parses/pdf_json/*.json": Where to find the json files.

How to Import

./import.sh

What's Imported

Each json file is a big one has a lot of data included. We don't need all of them. Only the following fields are imported for this testing:

  • paper_id: paper_id
  • title: metadata.title
  • text: body_text.text
  • section: body_text.section

Note the body_text is an array. We unwinded the array so that each text snippet is inserted as one document.
This is an example of the final document structure:

{
  "_id": {
    "$oid": "6619439e4728952eae60aeb8"
  },
  "paper_id": "0000028b5cc154f68b8a269f6578f21e31f62977",
  "title": "\"Multi-faceted\" COVID-19: Russian experience",
  "text": "According to current live statistics at the time of editing this letter, Russia has been the third country in the world to be affected by COVID-19 with both new cases and death rates rising. It remains in a position of advantage due to the later onset of the viral spread within the country since the worldwide disease outbreak.",
  "section": "Editor"
}

Peroformance Test

The Logic

  • The application first load numSamples documents from the collection. The embedding in these documents will be used for later test.
  • When a request arrives,
    • The application will randomly get 1 embedding from the previously loaded embeddings.
    • Use the embedding to do vector search.
    • The search result will return limit of numCandidates.
  • The full document (without embedding because it's big and is usually useless to the client) will be returned to the client.

Dependencies

  • NodeJS v18.
  • Source code in /performance-test folder.
  • Packages and tools:
cd performance-test
npm install
npm install -g pm2

Run

To start:

pm2 start bin/www -i max --watch

To review logs:

pm2 log www

To stop:

pm2 stop www

To remove

pm2 delete www

Test

Apache ab is used for testing

yum install httpd
ab -n 100 -c 1 http://localhost/vector-search

inditex-poc's People

Contributors

zhangyaoxing avatar

Watchers

 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.