Skip to main content

Bronze / Silver / Gold 텍스트 처리 실습 라이브러리

Project description

rag_lab

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

설치

pip install rag_lab

사용 예시

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rag_lab_bsg-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rag_lab_bsg-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file rag_lab_bsg-0.1.0.tar.gz.

File metadata

  • Download URL: rag_lab_bsg-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for rag_lab_bsg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec5f216bf41c48aab036ea39cc3d3fa1f8aa54f08ea278c720eaf3cb88cb3063
MD5 1cbe565a1e34966543a255eea81a3ffb
BLAKE2b-256 b4aff24f567c410fdb0b79a79df0259bfcb8cb145e045e54fe362e41f14b8ada

See more details on using hashes here.

File details

Details for the file rag_lab_bsg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rag_lab_bsg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for rag_lab_bsg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fda3cc7706dd7fdb5e4a373a99de4a09cd535af7c555911d4c80c6a0b352ce5
MD5 d026826fe98a8e34d08f650740d34c1c
BLAKE2b-256 328838d088f7687c3e5ac00900cb66047e08ed61064eec23e0de52d29357394a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page