Git Product home page Git Product logo

chat-your-doc's Introduction

Awesome LLMs applications and experiments

Chat Your Doc is an experimental project aimed at exploring various applications based on LLM. Although it is nominally a chatbot project, its purpose is broader. The project explores various applications using tools such as LangChain or scikit-learn LLM. In the "Lab Apps" section, you can find many examples, including simple and complex ones. The project focuses on researching and exploring various LLM applications, while also incorporating other fields such as UX and computer vision. The "Lab App" section includes a table with links to various apps, descriptions, launch commands, and demos.



Setup

Some keys

For OpenAI, set API-KEY to your environment variables.

Get OpenAI API-KEY

export OPENAI_API_KEY="sk-$TJHGFHJDSFDGAFDFRTHT§$%$%&§%&"

Conda

conda env create -n chat-ur-doc -f environment.yml
conda activate chat-ur-doc

Pip

pip install -r requirements.txt

Storage

ref: https://python.langchain.com/docs/modules/data_connection/vectorstores/

Chroma, FAISS

pip install chromadb

pip install faiss-cpu

Popular solutions

App Models & Components Description Launch Demo
chat_ur_docs.py ConversationalRetrievalChain, ConversationBufferMemory, ChatOpenAI, LangChain Chat with documents freely streamlit run advanced/chat_ur_docs.py --server.port 8004 --server.enableCORS false
chatbot.py ConversationChain, ConversationBufferMemory, ChatOpenAI, LangChain Basic chatbot streamlit run simple/chatbot.py --server.port 8003 --server.enableCORS false
faiss_app.py OpenAI, FAISS, OpenAIEmbeddings, RecursiveCharacterTextSplitter, VectorDBQAWithSourcesChain LangChain Ask info from a internet file, find similar docs and answer with VectorDBQAWithSourcesChain streamlit run advanced/faiss_app.py --server.port 8005 --server.enableCORS false

Simple

App Models & Components Description Launch Demo
i-ask.sh OpenAI http-request Simply ask & answer via OpenAI API i-ask.sh "Who is Joe Biden?"
chat_openai.py ChatOpenAI, LangChain Just one chat session streamlit run simple/chat_openai.py --server.port 8000 --server.enableCORS false
open_api_llm_app.py OpenAI, LLMChain, LangChain Use OpenAI LLM to answer simple question streamlit run simple/open_api_llm_app.py --server.port 8001 --server.enableCORS false
read_html_app.py CharacterTextSplitter, LangChain Get html content and chunk streamlit run simple/read_html_app.py --server.port 8002 --server.enableCORS false
💥 chatbot.py ConversationChain, ConversationBufferMemory, ChatOpenAI, LangChain Basic chatbot streamlit run simple/chatbot.py --server.port 8003 --server.enableCORS false

Intermediate

App Models & Components Description Launch Demo
💥 sim_app.py Chroma, RecursiveCharacterTextSplitter, OpenAIEmbeddings, LangChain Use the vector database to save file in chunks and retrieve similar content from the database streamlit run intermediate/sim_app.py --server.port 8002 --server.enableCORS false
llm_chain_translator_app.py ChatOpenAI, LLMChain, LangChain Use LLMChain to do language translation streamlit run intermediate/llm_chain_translator_app.py --server.port 8003 --server.enableCORS false
html_summary_chat_app.py ChatOpenAI, LangChain Summary html content streamlit run intermediate/html_summary_chat_app.py --server.port 8004 --server.enableCORS false
💥 html_2_json_app.py ChatOpenAI, LangChain Summary html keypoints into keypoint json streamlit run intermediate/html_2_json_app.py --server.port 8005 --server.enableCORS false

💥 Advanced

App Models & Components Description Launch Demo
qa_chain_pdf_app.py OpenAI, Chroma, RecursiveCharacterTextSplitter, load_qa_chain->BaseCombineDocumentsChain, LangChain Ask info from PDF file, chat with it streamlit run advanced/qa_chain_pdf_app.py --server.port 8004 --server.enableCORS false
faiss_app.py OpenAI, FAISS, OpenAIEmbeddings, RecursiveCharacterTextSplitter, VectorDBQAWithSourcesChain LangChain Ask info from a internet file, find similar docs and answer with VectorDBQAWithSourcesChain streamlit run advanced/faiss_app.py --server.port 8005 --server.enableCORS false
html_2_json_output_app.py ResponseSchema, StructuredOutputParser, LangChain Load html content and summary into json objects streamlit run advanced/html_2_json_output_app.py --server.port 8006 --server.enableCORS false
joke_bot.py ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate ResponseSchema, StructuredOutputParser, ChatOpenAI, LangChain Prompt engineering to get one random joke or rate one joke python advanced/joke_bot.py --rate "Why couldn't the bicycle stand up by itself? It was two tired." or python advanced/joke_bot.py --tell --num 4
chat_ur_docs.py ConversationalRetrievalChain, ConversationBufferMemory, ChatOpenAI, LangChain Chat with documents freely streamlit run advanced/chat_ur_docs.py --server.port 8004 --server.enableCORS false

Notes

These key notes can be very helpful in getting up to speed quickly. Look for them while you're learning and share them with others. These notes are especially useful when you're asking yourself questions like why, what, and how. <style> table { width: 100%; border-collapse: collapse; } td { padding: 8px; text-align: center; } img { width: 100%; height: auto; } @media screen and (max-width: 600px) { table, td, tr { display: block; } td { text-align: center; border-bottom: none; } } </style>

chat-your-doc's People

Contributors

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