Metadata-Version: 2.4
Name: rag-lab-bsg
Version: 0.1.1
Summary: Bronze / Silver / Gold 텍스트 처리 실습 라이브러리
Author-email: Park Un Woo <uwpark@simplatform.com>
License: MIT
Keywords: bronze-silver-gold,langchain,rag,text-splitter
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: langchain-community>=0.3.0
Requires-Dist: langchain-text-splitters>=0.3.0
Requires-Dist: pypdf>=4.0.0
Provides-Extra: notebook
Requires-Dist: ipykernel>=6.0; extra == 'notebook'
Requires-Dist: jupyterlab>=4.0; extra == 'notebook'
Description-Content-Type: text/markdown

# rag_lab

Bronze / Silver / Gold 3단계로 텍스트를 처리하는 RAG 실습용 라이브러리.

## 설치

```bash
pip install rag-lab-bsg
```

설치 패키지명은 `rag-lab-bsg` 이지만, 임포트 이름은 `rag_lab` 입니다.

## 사용 예시

```python
from rag_lab import bronze, silver, gold

# 1) Bronze — 원본 문서를 .txt 로 추출
txt_path = bronze.to_text("data/input/manual.pdf")

# 2) Silver — 글자 수 기준 단순 분할 (.jsonl)
silver_path = silver.split(txt_path, chunk_size=300, chunk_overlap=30)

# 3) Gold — 단락/문장 경계를 살리는 재귀 분할 (.jsonl)
gold_path = gold.split(silver_path, chunk_size=300, chunk_overlap=30)
```

각 단계의 함수는

- 다음 단계 입력으로 쓸 산출물(.txt / .jsonl) 경로를 반환하고
- 호출 결과를 화면에도 짧게 출력합니다.

## 단계 설명

| 단계 | 입력 | 출력 | 핵심 동작 |
|---|---|---|---|
| Bronze | PDF / TXT / MD | `.txt` | 원본 보존, 페이지 사이는 빈 줄로만 구분 |
| Silver | Bronze `.txt` | `.jsonl` | `CharacterTextSplitter` — 의미 무시, 글자 수로 분할 |
| Gold   | Silver `.jsonl` | `.jsonl` | `RecursiveCharacterTextSplitter` — 단락 → 문장 → 어절 |

## 요구 사항

- Python 3.10+
- `langchain-community`, `langchain-text-splitters`, `pypdf`
