RAG Chatbot with Confluence
1.0.0
幫助台可讓您使用公司 Confluence 資料建立具有精簡 UI 的問答機器人。
建立虛擬環境:
python3.10 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
複製 env.template 並填入您的環境變量
cp .env.template .env
檢查config.py
和env.template
檔。
要從 Confluence 收集數據,您必須:
env
檔中插入:https://yoursite.atlassian.com/wiki/spaces/<space_key>/pages/
/<space_name>/spaces/<space_key>/pages/
要運行 Streamlit 應用程序,請運行:
cd src
streamlit run streamlit.py
# First replace the evaluation dataset file in the data folder with your topic questions
cd src
python evaluate.py
ipython kernel install --name RAG --user # Add the notebook kernel
jupyter lab
.
├── data/
├── evaluation_dataset.tsv # Questions and answers useful for evaluation
├── docs/ # Documentation files
├── src/ # The main directory for computer demo
├── __init__.py
├── load_db.py # Load data from confluence and creates smart chunks
├── help_desk.py # Instantiates the LLMs, retriever and chain
├── main.py # Run the Chatbot for a simple question
├── streamlit.py # Run the Chatbot in streamlit where you can ask your own questions
├── evaluate.py # Evaluate the RAG model based on questions-answers samples
├── notebooks/ # Interactive code, useful for try and learn
├── config.py
├── .env.template # Environment variables to feed
├── .gitignore
├── LICENSE # MIT License
├── README.md # Where to start
└── requirements.txt # The dependencies
流程如下:
keep_markdown_format
選項來保留 Markdown 樣式help_desk.ipynb
進行更深入的分析