Package: buster-doctalk
Buster, the QA documentation chatbot!Buster is a question-answering chatbot that can be tuned to any source of documentations.DemoIn order to view the full abilities of Buster, you can play with ourlive demo here.
We scraped the documentation ofhuggingface 🤗 Transformersand instructed Buster to answer questions related to its usage.QuickstartThis section is meant to help you install and run local version of Buster.
First step, install buster:Note: Buster requires python>=3.10pipinstallbuster-doctalkThen, go to the examples folder and launch the app.
We've included small sample data off stackoverflow-ai questions that you can test your setup with to try app:cdbuster/buster/examples
gradiogradio_app.pyThis will launch the gradio app locally.NOTE: The demo uses chatGPT to generate text and compute embeddings, make sure to set a valid openai API key:exportOPENAI_API_KEY=sk-...Generating your own embeddingsOnce your local version of Buster is up and running, the next step is for you to be able to import your own data.
We will be using thestackoverflow.csvfile in thebuster/examples/folder for this. This is the same data that was used to generate the demo app's embeddings.You will first ingest the documents to be ready for buster. In this example, we use Deeplake's vector store, but you can always write your own customDocumentManager:importpandasaspdfrombuster.documents_managerimportDeepLakeDocumentsManager# Read the csvdf=pd.read_csv("stackoverflow.csv")# Generate the embeddings for our documents and store them in a deeplake formatdm=DeepLakeDocumentsManager(vector_store_path="deeplake_store",overwrite=True)dm.add(df)You can also just simply run the script:python generate_embeddings.py --csv stackoverflow.csvThis will generate the embeddings and save them locally in thedeeplake_store.NOTE: You will need to set a valid openai key for computing embeddings:exportOPENAI_API_KEY=sk-...You only need to run this operation one time.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 displayurl: the link that clicking the title will redirect tosource: where the content was originally sourced from (e.g. wikipedia, stackoverflow, etc.)content: plaintext of the documents to be embedded. It is your responsibility to chunk your documents appropriately. For better results, we recommend chunks of 400-600 words.Additional ConfigurationsProperly prompting models as well as playing around with various model parameters can lead to different results. We use aBusterConfigobject to keep track of the various Buster configurations. In thebuster/examples/folder, the config is stored insidecfg.py. Modify this config to update parameters, prompts, etc.How does Buster work?First, we parsed the documentation into snippets. For each snippet, we obtain an embedding by using theOpenAI 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 theOpenAI API, and display the answer to the user!Currently available modelsFor embeddings: "text-embedding-ada-002"For completion: We support both "gpt-3.5-turbo" and "gpt-4"LivestreamFor more information, you can watch the livestream where explain how buster works in detail!Livestream recording