agric1 / README.md
andrewcarr6239's picture
Update README.md
e5fa5b8 verified

A newer version of the Streamlit SDK is available: 1.41.1

Upgrade
metadata
title: Agronomy
sdk: streamlit
emoji: πŸš€
colorFrom: green
colorTo: blue

ElasticDocs_GPT

Combining the search power of Elasticsearch with the Question Answering power of GPT


title: {{title}} emoji: {{emoji}} colorFrom: {{colorFrom}} colorTo: {{colorTo}} sdk: {{sdk}} sdk_version: {{sdkVersion}} app_file: app.py pinned: false

Blog - ChatGPT and Elasticsearch: OpenAI meets private data

diagram

  1. Python interface accepts user questions
  • Generate a hybrid search request for Elasticsearch
  • BM25 match on the title field
  • kNN search on the title-vector field
  • Boost kNN search results to align scores
  • Set size=1 to return only the top scored document
  1. Search request is sent to Elasticsearch
  2. Documentation body and original url are returned to python
  3. API call is made to OpenAI ChatCompletion
  • Prompt: "answer this question using only this document "
  1. Generated response is returned to python
  2. Python adds on original documentation source url to generated response and prints it to the screen for the user

Examples

autoscale

apm

inference

pii