Cchangyu commited on
Commit
7ae0094
Β·
1 Parent(s): 09b7e5b

README.md update

Browse files
Files changed (1) hide show
  1. README.md +34 -34
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: 곡정선거보도 RAG 챗봇
3
  emoji: πŸ—³οΈ
4
  colorFrom: blue
5
  colorTo: indigo
@@ -10,30 +10,30 @@ pinned: false
10
  license: mit
11
  ---
12
 
13
- # πŸ—³οΈ 곡정선거보도 μ•ˆλ‚΄μ„œ RAG 챗봇
14
 
15
- μΈν„°λ„·μ„ κ±°λ³΄λ„μ‹¬μ˜μœ„μ›νšŒμ˜ **γ€Œ2026 곡정선거보도 μ•ˆλ‚΄μ„œγ€**(μ•½ 105μͺ½)λ₯Ό ν•™μŠ΅ν•œ
16
- 검색-증강 생성(RAG) μ±—λ΄‡μž…λ‹ˆλ‹€. μ§ˆλ¬Έμ— λŒ€ν•΄ μ•ˆλ‚΄μ„œ λ³Έλ¬Έμ—μ„œ κ΄€λ ¨ λ‚΄μš©μ„ μ°Ύμ•„
17
- **좜처 νŽ˜μ΄μ§€ λ²ˆν˜Έμ™€ ν•¨κ»˜** λ‹΅λ³€ν•©λ‹ˆλ‹€.
18
 
19
- ## μ‚¬μš© 방법
20
 
21
- 1. μ‚¬μ΄λ“œλ°”μ˜ μ˜ˆμ‹œ 질문 λ²„νŠΌμ„ λˆ„λ₯΄κ±°λ‚˜, ν•˜λ‹¨ μž…λ ₯창에 직접 질문 μž…λ ₯
22
- 2. λ‹΅λ³€κ³Ό ν•¨κ»˜ ν‘œμ‹œλ˜λŠ” `[νŽ˜μ΄μ§€ N]` 좜처λ₯Ό μ›λ¬Έμ—μ„œ 확인
23
- 3. μ΄μ–΄μ§€λŠ” μ§ˆλ¬Έμ€ 이전 λ§₯락을 κ³ λ €ν•΄ μžμ—°μŠ€λŸ½κ²Œ λ‹΅λ³€ (λ©€ν‹°ν„΄ λŒ€ν™”)
24
- 4. λŒ€ν™”λ₯Ό μ²˜μŒλΆ€ν„° μ‹œμž‘ν•˜λ €λ©΄ μ‚¬μ΄λ“œλ°”μ˜ **πŸ—‘οΈ λŒ€ν™” μ΄ˆκΈ°ν™”** 클릭
25
 
26
- ## 기술 μŠ€νƒ
27
 
28
- | ꡬ성 μš”μ†Œ | μ‚¬μš© 기술 |
29
  |---|---|
30
- | ν”„λ‘ νŠΈμ—”λ“œ | Streamlit |
31
- | μž„λ² λ”© λͺ¨λΈ | Gemini Embedding 001 (768차원) |
32
- | 벑터 DB | Chroma (사전 λΉŒλ“œλœ 영ꡬ μ €μž₯μ†Œ) |
33
- | 생성 λͺ¨λΈ | Gemini 2.5 Flash-Lite |
34
- | 배포 | Hugging Face Spaces |
35
 
36
- ## λ™μž‘ 원리
37
 
38
  ```
39
  질문 μž…λ ₯
@@ -47,37 +47,37 @@ Chroma DBμ—μ„œ 코사인 μœ μ‚¬λ„ Top-5 청크 검색
47
  좜처 νŽ˜μ΄μ§€κ°€ ν‘œμ‹œλœ ν•œκ΅­μ–΄ λ‹΅λ³€ 생성
48
  ```
49
 
50
- ## ν™˜κ²½ λ³€μˆ˜
51
 
52
- Space의 **Settings β†’ Variables and secrets**에 μ•„λž˜ ν•­λͺ© 등둝 ν•„μš”:
53
 
54
- - `GEMINI_API_KEY` β€” Google AI Studioμ—μ„œ λ°œκΈ‰ (https://aistudio.google.com/apikey)
55
 
56
- ## λ‘œμ»¬μ—μ„œ μ‹€ν–‰ν•˜κΈ°
57
 
58
- 1. 의쑴 νŒ¨ν‚€μ§€ μ„€μΉ˜ (κ°€μƒν™˜κ²½ ꢌμž₯)
59
 
60
  ```bash
61
  pip install -r requirements.txt
62
  ```
63
 
64
- 2. 같은 폴더에 `.env` νŒŒμΌμ„ λ§Œλ“€κ³  ν•œ 쀄 μΆ”κ°€
65
 
66
  ```
67
  GEMINI_API_KEY=본인의_Gemini_API_ν‚€
68
  ```
69
 
70
- 3. 사전 λΉŒλ“œλœ `chroma_election_db/` 폴더가 같은 κ²½λ‘œμ— μžˆλŠ”μ§€ 확인
71
 
72
- 4. Streamlit으둜 μ•± μ‹€ν–‰ (파이썬 직접 싀행이 μ•„λ‹˜μ— 유의)
73
 
74
  ```bash
75
  streamlit run RAG챗봇_배포.py
76
  ```
77
 
78
- λΈŒλΌμš°μ €κ°€ μžλ™μœΌλ‘œ 열리지 μ•ŠμœΌλ©΄ http://localhost:8501 둜 μ ‘μ†ν•˜μ„Έμš”.
79
 
80
- ## 파일 ꡬ쑰
81
 
82
  ```
83
  .
@@ -89,11 +89,11 @@ Space의 **Settings β†’ Variables and secrets**에 μ•„λž˜ ν•­λͺ© 등둝 ν•„μš”:
89
  └── <UUID 폴더>/
90
  ```
91
 
92
- 벑터 DBλŠ” 별도 λΉŒλ“œ 슀크립트둜 미리 μƒμ„±λ˜μ–΄ μžˆμ–΄μ•Ό ν•˜λ©°,
93
- μ•± μ‹€ν–‰ μ‹œμ—λŠ” μ²­ν‚ΉΒ·μž„λ² λ”© μž‘μ—…μ„ μˆ˜ν–‰ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
94
 
95
- ## 주의 사항
96
 
97
- - λ³Έ μ±—λ΄‡μ˜ 닡변은 μ•ˆλ‚΄μ„œ 본문에 κ·Όκ±°ν•˜μ§€λ§Œ, μ΅œμ’… νŒλ‹¨κ³Ό μΈμš©μ€ **원문 확인** ν›„ μ‚¬μš©ν•΄ μ£Όμ„Έμš”.
98
- - 무료 ν‹°μ–΄ ν™˜κ²½μ—μ„œλŠ” 일정 μ‹œκ°„ λ―Έμ‚¬μš© μ‹œ Spaceκ°€ 슬립 μƒνƒœκ°€ λ˜μ–΄ 첫 μš”μ²­μ— 30μ΄ˆκ°€λŸ‰ 걸릴 수 μžˆμŠ΅λ‹ˆλ‹€.
99
- - Gemini API ν˜ΈμΆœμ—λŠ” λ³„λ„μ˜ μ‚¬μš©λŸ‰/μš”κΈˆ 정책이 μ μš©λ©λ‹ˆλ‹€.
 
1
  ---
2
+ title: Fair Election Reporting RAG Chatbot
3
  emoji: πŸ—³οΈ
4
  colorFrom: blue
5
  colorTo: indigo
 
10
  license: mit
11
  ---
12
 
13
+ # πŸ—³οΈ Fair Election Reporting Guide RAG Chatbot
14
 
15
+ This retrieval-augmented generation (RAG) chatbot uses the Internet Election News
16
+ Deliberation Commission's approximately 105-page **2026 Fair Election Reporting Guide**.
17
+ It finds relevant information in the guide and answers questions **with source page numbers**.
18
 
19
+ ## How to Use
20
 
21
+ 1. Select a sample question in the sidebar, or enter your own question in the input field at the bottom.
22
+ 2. Verify the `[νŽ˜μ΄μ§€ N]` citation shown with the answer against the original guide.
23
+ 3. Ask follow-up questions; the chatbot uses the previous context to respond naturally (multi-turn conversation).
24
+ 4. To start over, click **πŸ—‘οΈ λŒ€ν™” μ΄ˆκΈ°ν™”** in the sidebar.
25
 
26
+ ## Technology Stack
27
 
28
+ | Component | Technology |
29
  |---|---|
30
+ | Frontend | Streamlit |
31
+ | Embedding model | Gemini Embedding 001 (768 dimensions) |
32
+ | Vector DB | Chroma (prebuilt persistent store) |
33
+ | Generative model | Gemini 2.5 Flash-Lite |
34
+ | Deployment | Hugging Face Spaces |
35
 
36
+ ## How It Works
37
 
38
  ```
39
  질문 μž…λ ₯
 
47
  좜처 νŽ˜μ΄μ§€κ°€ ν‘œμ‹œλœ ν•œκ΅­μ–΄ λ‹΅λ³€ 생성
48
  ```
49
 
50
+ ## Environment Variables
51
 
52
+ Add the following entry under **Settings β†’ Variables and secrets** in the Space:
53
 
54
+ - `GEMINI_API_KEY` β€” Obtain from Google AI Studio (https://aistudio.google.com/apikey)
55
 
56
+ ## Run Locally
57
 
58
+ 1. Install the dependencies (a virtual environment is recommended).
59
 
60
  ```bash
61
  pip install -r requirements.txt
62
  ```
63
 
64
+ 2. Create a `.env` file in the same directory and add the following line.
65
 
66
  ```
67
  GEMINI_API_KEY=본인의_Gemini_API_ν‚€
68
  ```
69
 
70
+ 3. Make sure the prebuilt `chroma_election_db/` directory is in the same location.
71
 
72
+ 4. Run the app with Streamlit rather than invoking Python directly.
73
 
74
  ```bash
75
  streamlit run RAG챗봇_배포.py
76
  ```
77
 
78
+ If the browser does not open automatically, open http://localhost:8501 in your browser.
79
 
80
+ ## File Structure
81
 
82
  ```
83
  .
 
89
  └── <UUID 폴더>/
90
  ```
91
 
92
+ The vector DB must be generated in advance with a separate build script.
93
+ The app does not perform chunking or embedding at runtime.
94
 
95
+ ## Notes
96
 
97
+ - The chatbot's answers are based on the guide, but verify the **original guide** before using them for final decisions or citations.
98
+ - On the free tier, the Space may go to sleep after a period of inactivity, so the first request may take approximately 30 seconds.
99
+ - Separate usage limits and pricing policies apply to Gemini API calls.