Code Monkey home page Code Monkey logo

vectordb's Introduction

Multi-Class Classification with OpenAI and Vector Search

Pre-Requisites

  • Azure OpenAI
    • Embedding Model (text-embedding-ada-002)
    • Chat Model (gpt-35-turbo)
  • Azure Cognitive Search

Setup

  1. Clone the repository.
  2. Create a Python virtual environment python3 -m venv env.
  3. Install Python depencies pip install -r requirements.txt.
  4. Rename config.ini.template to config.ini.
  5. Update the variables within config.ini based on your values from the Azure portal.
  6. Rename documents.json.template to documents.json. Update the contents of the JSON file with category and content pairs to pre-populate the vector database.
  7. Create a chat API messages template beneath a folder called messages. Note: See messages.json as an example structure.

Usage

  • populate_vector_index.py - Running this script will drop/create a vector search index in Azure Cognitive Search based on the documents within documents.json.
  • query_vector_index.py --query "YOUR_QUERY" - Running this script will query the populated vector database for the nearest neighbors.
  • classify_text_snippet.py --snippet "YOUR_SNIPPET" - Running this script will use the chat completion API to classify the snippet.

vectordb's People

Contributors

tayganr 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.