Giter Club home page Giter Club logo

buster's Introduction

Buster, the QA documentation chatbot!

Buster is a question-answering chatbot that can be tuned to any source of documentations.

Demo

You can try out our live demo here, where it will answer questions about a bunch of libraries we've already scraped, including ๐Ÿค— Transformers.

Quickstart

Here is a quick guide to help you deploy buster on your own dataset!

We will look at deploying a simple app locally. First step, install buster. Note that buster requires python>=3.10.

git clone https://github.com/jerpint/buster.git
pip install .

Then, go to the examples folder:

cd buster/buster/examples

We've attached a sample stackoverflow.csv file to help you get started.

You will first ingest the documents to be ready for buster. In this example, we use Deeplake's vectore store, but you can always write your own custom DocumentManager:

import pandas as pd
from buster.documents_manager import DeepLakeDocumentsManager

# Read the csv
df = pd.read_csv("stackoverflow.csv")

# Generate the embeddings for our documents and store them in a deeplake format
dm = DeepLakeDocumentsManager(vector_store_path="deeplake_store", overwrite=True)
dm.add(df)

You can also just simply run the script:

python generate_embeddings.py

This will generate the embeddings and save them locally in the deeplake_store folder. Note: You only need to run this operation one time.

Now, you can launch your gradio app:

gradio gradio_app.py

This will launch the gradio app locally, which you should be able to view on localhost

In the .csv, we expect columns ["title", "url", "content", "source"] for each row of the csv:

  • title: this will be the title of the url to display
  • url: the actual link that will be shown to the user
  • source: where the content was originally sourced from (e.g. wikipedia, medium, etc.)
  • content: plaintext of the document to be embedded. Note that we do not do any chunking (yet). It is your responsibility to ensure each document is of an appropriate context length.

How does Buster work?

First, we parsed the documentation into snippets. For each snippet, we obtain an embedding by using the OpenAI API.

Then, when a user asks a question, we compute its embedding, and find the snippets from the doc with the highest cosine similarity to the question.

Finally, we craft the prompt:

  • The most relevant snippets from the doc.
  • The engineering prompt.
  • The user's question.

We send the prompt to the OpenAI API, and display the answer to the user!

Currently available models

  • For embeddings: "text-embedding-ada-002"
  • For completion: We support both "text-davinci-003" and "gpt-3.5-turbo"

Livestream

For more information, you can watch the livestream where explain how buster works in detail!

buster's People

Contributors

jerpint avatar hbertrand avatar marondeau avatar marondeau-mila 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.