chatwine-korean / readme.md
SungBeom's picture
Upload folder using huggingface_hub
4a51346
---
title: chatwine
app_file: app.py
sdk: gradio
sdk_version: 3.35.2
---
## ์šฐ๋ฆฌ๊ฐ€ ๋ฌด์–ผ ํ•˜๋Š”๊ฐ€
์™€์ธ์— ๋Œ€ํ•œ ์ง€์‹์ด ์—†๋Š” ์‚ฌ๋žŒ๋„ ์™€์ธ์„ ์‰ฝ๊ฒŒ ์ฆ๊ธธ ์ˆ˜ ์žˆ๋„๋ก ๊ฐœ์ธ์˜ ์™€์ธ ๊ตฌ๋งค์™€ ์„ฑํ–ฅํŒŒ์•…์„ ๋•๊ณ , ์ถ”์ฒœ๋ฐ›์€ ์™€์ธ์„ ๊ตฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ๋งค์žฅ์˜ ์ •๋ณด ์ œ๊ณต.
## ์šฐ๋ฆฌ ์ œํ’ˆ์˜ ๊ธฐ๋Šฅ
1. ์™€์ธ ์ถ”์ฒœ: ์‚ฌ์šฉ์ž์˜ ์„ฑํ–ฅ์„ ํŒŒ์•…ํ•˜๊ณ , ์ ์ ˆํ•œ ์™€์ธ์„ ์ถ”์ฒœํ•œ๋‹ค. ํ•œ๊ตญ๋‚ด์—์„œ ๊ตฌ๋งคํ•  ์ˆ˜ ์žˆ๋Š” ์™€์ธ์„ ์ถ”์ฒœํ•˜๊ณ , ๊ตฌ๋งค ๋งํฌ ์ œ๊ณต์„ ๋ชฉํ‘œ๋กœ ํ•œ๋‹ค.
2. ์™€์ธ Q&A: ์‚ฌ์šฉ์ž๊ฐ€ ์งˆ๋ฌธ์„ ํ•˜๋ฉด ๊ทธ์— ์ ์ ˆํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•œ๋‹ค.
3. ์™€์ธ๋ฐ” ์ถ”์ฒœ: ์‚ฌ์šฉ์ž์˜ ์ƒํ™ฉ, ์œ„์น˜ ๋“ฑ์— ๋”ฐ๋ผ์„œ ์ ์ ˆํ•œ ์™€์ธ๋ฐ”๋ฅผ ์ถ”์ฒœํ•œ๋‹ค.
๋น ๋ฅธ ์ œํ’ˆ ๊ฐœ๋ฐœ์„ ์œ„ํ•ด [Langchain](https://github.com/hwchase17/langchain)์„ ์‚ฌ์šฉํ•œ๋‹ค. Langchain์€ ์–ธ์–ด ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜๋Š” ์ œํ’ˆ ๊ฐœ๋ฐœ์— ๋„์›€์„ ์ฃผ๋Š” ํ”„๋ ˆ์ž„์›Œํฌ์ด๋‹ค.
### ์•„๋ž˜๋Š” Langchain ํ•™์Šต ์ž๋ฃŒ
๋จผ์ € deeplearning AI ๊ฐ•์˜๋ฅผ ๋“ฃ๊ณ , documentation์˜ Quickstart์™€ Modules๋ถ€๋ถ„์„ ์ฒœ์ฒœํžˆ ๋”ฐ๋ผ๊ฐ€ ๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค.
- documentation: [documenatation ๋งํฌ](https://python.langchain.com/docs/get_started/quickstart) <br>
- Deeplearning AI ๊ฐ•์˜(2์‹œ๊ฐ„): [๊ฐ•์˜๋งํฌ](https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/)
- ์šฐ๋ฆฌ๋ชจ๋ธ๊ณผ ๋น„์Šทํ•œ ๊ตฌ์กฐ๋กœ ๊ตฌํ˜„๋œ ์ž๋ฃŒ(Sales GPT): [Sales GPT](https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context)
## ์šฐ๋ฆฌ ๋ชจ๋ธ ๊ตฌ์กฐ
<img src="./assets/architecture.png" width="500" height="500">
### ๊ตฌ์„ฑ ์š”์†Œ
- Assistant: ๋Œ€ํ™” ๊ธฐ๋ก์„ ๋ณด๊ณ , ๋‹ค์Œ์— Agent๊ฐ€ ์ทจํ•ด์•ผํ•  ์ ์ ˆํ•œ ํ–‰๋™์„ ์ถœ๋ ฅํ•œ๋‹ค.
- Agent: ๋Œ€ํ™” ๊ธฐ๋ก๊ณผ Assistant์—์„œ ์ถœ๋ ฅํ•œ ํ–‰๋™์— ๋”ฐ๋ผ ๋„๊ตฌ๋ฅผ ํ™œ์šฉํ•ด ์œ ์ €์—๊ฒŒ ์ „๋‹ฌํ•  ์ ์ ˆํ•œ ์‘๋‹ต์„ ์ƒ์„ฑํ•œ๋‹ค.
- Tools: ์™ธ๋ถ€ ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋„๊ตฌ
- Database: ์™€์ธ, ์™€์ธ๋ฐ” ๋“ฑ์˜ ์ •๋ณด๊ฐ€ ๋‹ด๊ฒจ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค
- Web: ๋ง๊ทธ๋Œ€๋กœ ์›น(๊ตฌ๊ธ€)
## requirements
- pip install langchain
- pip install openai
- pip install ipykernel
- pip install pandas
- pip install chromadb
- pip install tiktoken
- pip install lark
- pip install "langchain[docarray]"
- pip install google-search-results
- pip install gradio
### ๊ฐ€์žฅ ๋จผ์ € [quickstart ๋…ธํŠธ๋ถ](quickstart.ipynb)์„ ํ†ตํ•ด ์ „์ฒด ๋ชจ๋“ˆ์„ ํŒŒ์•…ํ•ด๋ณด์„ธ์š”!
## TODO
### Assistant
- [Assistant ๋…ธํŠธ๋ถ](./assistant.ipynb)
- ๋ชฉํ‘œ: Assistant evaluation set์— ๋Œ€ํ•ด 95% ์ด์ƒ์œผ๋กœ Agent์˜ ๋‹ค์Œ action์„ ์˜ˆ์ธก
### ๋Œ€ํ™” ๋ฐ์ดํ„ฐ์…‹ ์ œ์ž‘
- [Dialog dataset ์ œ์ž‘ ๋…ธํŠธ๋ถ](./generate_dialog.ipynb)
- ๋ชฉํ‘œ: ์šฐ๋ฆฌ ์ฑ—๋ด‡์—์„œ ์ผ์–ด๋‚ ๋งŒํ•œ ๋Œ€ํ™” ๋ฐ์ดํ„ฐ์…‹ 100๊ฐœ ์ œ์ž‘
### Evaluation Set ์ œ์ž‘
- [Evaluation Set ์ œ์ž‘ ๋…ธํŠธ๋ถ](./generate_evaluation.ipynb)
- ๋ชฉํ‘œ: Assistant์™€ Agent evaluation set ์ œ์ž‘
### Tools ๋ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ œ์ž‘
- [Langchain Tools ๋…ธํŠธ๋ถ](./tools.ipynb)
### ์™€์ธ ๋ฐ ์™€์ธ๋ฐ” database ์ œ์ž‘
- [wine database ์ œ์ž‘ ๋…ธํŠธ๋ถ](./crawl_wine.ipynb)
- [winebar database ์ œ์ž‘ ๋…ธํŠธ๋ถ](./crawl_winebar.ipynb)
- ๋ชฉํ‘œ: ํฌ๋กค๋ง์„ ํ†ตํ•œ ์™€์ธ ๋ฐ ์™€์ธ๋ฐ” database ์ œ์ž‘
### Agent
- [Agent ๋…ธํŠธ๋ถ](./agent.ipynb)
### Gradio๋ฅผ ํ†ตํ•œ ์›น๋ฐ๋ชจ ์ œ์ž‘
- [Gradio ๋ฐฐํฌ ๋…ธํŠธ๋ถ](./gradio_web.ipynb)
- ๋ชฉํ‘œ: ์•ฑ ์ œ์ž‘ ์ „ ์–ธ์–ด๋ชจ๋ธ ํ…Œ์ŠคํŠธ ๋ฐ GPT4๋กœ ์ƒ์„ฑํ•œ ๋ฐ์ดํ„ฐ์…‹ ์‚ฌ๋žŒ์ด ๊ฒ€์ฆ ๋ฐ ์ˆ˜์ •