Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
rag_preprocessed_data.csv
rag_preprocessed_data.json
.env
chroma_db/
chroma_db/

__pycache__/
*.pyc
.DS_Store
*.egg-info/
.venv/
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,41 +44,37 @@ pip install -r requirements.txt

## 🚀 실행 순서 (Running Order)

1. **데이터 정제 (Data Cleaning):**
`creation_science_data.csv`를 정제하여 `cleaned_creation_science_data.csv`를 생성합니다.
1. **데이터 정제 + 전처리 (Data Pipeline):**
`creation_science_data.csv`를 정제하고, 청크로 나누어 `rag_preprocessed_data.json`을 생성합니다.

```bash
python data_cleaning.py
python data_pipeline.py
```

2. **데이터 전처리 (Data Preprocessing):**
정제된 CSV를 읽어 청크로 나누고 `rag_preprocessed_data.json`을 생성합니다.

```bash
python data_preprocessing_for_RAG.py
```

3. **벡터 DB 적재 (Vector DB Ingestion):**
2. **벡터 DB 적재 (Vector DB Ingestion):**
생성된 JSON 데이터를 `chroma_db` 폴더에 임베딩하여 저장합니다. (Ollama에서 `qwen3-embedding:8b` 모델이 실행 중이어야 합니다.)
```bash
python ingest_vector_db.py
```

3.1 **Google Drive에서 chroma_db 파일 다운**
1,2,3 뛰어 넘어도 됨.
2.1 **Google Drive에서 chroma_db 파일 다운**
1,2 뛰어 넘어도 됨.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix wording typo in Step 2.1.

Current sentence is awkward (1,2 뛰어 넘어도 됨.). Use a clearer form like 1, 2단계를 건너뛰어도 됩니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 61, Update the awkward Korean sentence in Step 2.1 (the
line currently reading "1,2 뛰어 넘어도 됨.") to the clearer phrasing "1, 2단계를 건너뛰어도
됩니다." so wording and spacing are correct; edit the README.md Step 2.1 section to
replace the old sentence with the new, properly spaced and polite form.

https://drive.google.com/file/d/1zdxkGgW2R2mLA_XRxAENbLTTPSnNydI2/view?usp=drive_link

4. **애플리케이션 실행 (Run App):**
3. **애플리케이션 실행 (Run App):**
Streamlit 웹 인터페이스를 실행합니다.
```bash
streamlit run app.py
```

## 📂 파일 구조 (File Structure)

- `app.py`: Streamlit 챗봇 UI, Hybrid Retriever 및 Reranker 로직
- `data_cleaning.py`: 중복 제거 및 노이즈 텍스트 정제
- `data_preprocessing_for_RAG.py`: RecursiveCharacterTextSplitter를 이용한 청킹
- `config.py`: 모델명, 경로, 파라미터 등 설정값 중앙 관리
- `app.py`: Streamlit 챗봇 UI
- `text_utils.py`: 텍스트 클리닝 및 태그 분리 유틸리티
- `retriever.py`: 문서 로딩, 벡터DB, 하이브리드 검색 및 Reranker 로직
- `chain.py`: LLM 프롬프트 및 생성 체인
- `data_pipeline.py`: 데이터 정제 + RAG 전처리/청킹 통합 파이프라인
- `ingest_vector_db.py`: ChromaDB 생성 및 Ollama 기반 임베딩 적재
- `creation_science_data.csv`: 원본 데이터셋
- `chroma_db/`: 벡터 데이터베이스 저장 폴더
33 changes: 32 additions & 1 deletion VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@

---

## [v0.0.4] - 2026-04-13 (최신 버전)
## [v0.0.5] - 2026-04-15 (최신 버전)

### 🌟 주요 특징 (Features)

- **코드 모듈 분리**: 단일 `app.py`(294줄)를 `config.py`, `text_utils.py`, `retriever.py`, `chain.py`, `app.py`(120줄)로 분리하여 유지보수성 및 테스트 용이성 향상.
- **설정값 중앙 관리**: 모델명, 경로, 파라미터 등 하드코딩된 설정값을 `config.py`로 통합하여 한 곳에서 관리.
- **중복 코드 제거**: `app.py`와 `ingest_vector_db.py`에 중복 존재하던 `load_documents()` 함수를 `retriever.py`로 통합.
- **데이터 파이프라인 통합**: `data_cleaning.py`와 `data_preprocessing_for_RAG.py`를 `data_pipeline.py`로 통합하여 1,2단계를 한 번에 실행.
- **Reranker 모델 자동 전환**: `config.py`에서 `RERANKER_MODEL`만 변경하면 BAAI/Qwen 모델에 맞는 kwargs가 자동 적용.
- **의존성 버전 고정**: `requirements.txt`에 최소 버전 제약을 추가하여 환경 재현성 향상.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Release note wording is inaccurate for dependency policy.

requirements.txt currently uses minimum bounds, not strict pinning. Consider changing “의존성 버전 고정” to “최소 버전 제약”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@VERSIONS.md` at line 16, The release note line "`**의존성 버전 고정**:
`requirements.txt`에 최소 버전 제약을 추가하여 환경 재현성 향상.`" is inaccurate because the file
uses minimum bounds rather than strict pinning; update that heading and/or text
in VERSIONS.md to read "`**최소 버전 제약**`" (or similar wording) and adjust the
description to state that `requirements.txt` uses minimum version constraints
rather than exact pins so the wording accurately reflects the dependency policy.

- **`.gitignore` 보강**: `__pycache__/`, `.DS_Store`, `.venv/` 등 표준 Python 제외 항목 추가.

### 🤖 모델 구성 (Models)

- **LLM (Generation):** `qwen2.5:14b` (via Ollama)
- **Embedding:** `qwen3-embedding:8b` (via Ollama)
- **Reranker:** `BAAI/bge-reranker-v2-m3` (via HuggingFace CrossEncoder)
- Optimization: `torch.float16` 적용

### 📂 변경된 파일 구조 (File Structure)

- `config.py` (신규): 설정값 중앙 관리
- `text_utils.py` (신규): 텍스트 클리닝 유틸리티
- `retriever.py` (신규): 문서 로딩, 검색, Reranker
- `chain.py` (신규): LLM 프롬프트 및 생성 체인
- `data_pipeline.py` (신규): 데이터 정제 + 전처리 통합
- `app.py` (리팩터링): UI 로직만 담당
- `ingest_vector_db.py` (리팩터링): 공통 모듈 임포트로 전환

---

## [v0.0.4] - 2026-04-13 (이전 버전)

### 🌟 주요 특징 (Features)

Expand Down
Loading