Skip to content

eGroupAI/document-prep-starter

document-prep-starter

CI  Python  License: MIT  Free & Open Source


.md / .txt 轉成帶 chunk_id 的 JSONL,方便直接接進批次處理或後續 pipeline。


安裝  ·  執行  ·  輸出格式  ·  Python API  ·  授權


安裝

python -m venv .venv
. .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -e .[dev]

執行

# 轉換文件
mdprep ingest --input ./examples/demo.md --output ./out/demo.jsonl --doc-id demo-001

# 驗證輸出格式
mdprep validate --input ./out/demo.jsonl

輸出格式

每行一筆 JSONL,欄位固定:

{"doc_id":"demo-001","chunk_id":"demo-0001","text":"# Demo","metadata":{"source":"public-starter-kit","char_length":6}}
{"doc_id":"demo-001","chunk_id":"demo-0002","text":"這是一份公開示範資料。","metadata":{"source":"public-starter-kit","char_length":11}}

Python API

from markitdown_prep.core import build_chunks, emit_jsonl

chunks = build_chunks(text="# Hello\n\nThis is a sample.", doc_id="sample-001")
emit_jsonl(chunks, "out.jsonl")

適合這些情境

  • 批次轉換多份文件,輸出統一格式供下游消費
  • 自建 ingestion 流程時需要一個有測試的基線
  • 只需要拆段 + 標準欄位,不需要額外 dependency

不包含

  • 真實資料與私有欄位定義
  • 任何業務規則、決策邏輯、Prompt

詳見 docs/threat-model.md


開發

pytest -q

授權

本專案採 MIT License 授權,永久免費、可商業使用、可修改、可散佈

License: MIT Free & Open Source

權利 說明
✅ 免費使用 個人、商業、學術皆可,不收費
✅ 可修改 可依需求自由調整原始碼
✅ 可散佈 可重新散佈原始或修改版本
✅ 可商業使用 可用於商業產品中
ℹ️ 保留聲明 散佈時需保留原始版權與授權聲明

版權所有 © 2026 eGroupAI 益群健康資訊


維護者

本 repo 由 eGroupAI 益群健康資訊 維護,作為公司開源貢獻的一部分。

項目 資訊
官網 https://www.egroupai.com/zh-TW
聯絡信箱 service@egroupai.com
GitHub 組織 github.com/eGroupAI

如有問題或建議,歡迎透過 GitHub Issues 或上述信箱與我們聯絡。

About

Public-safe starter kit for markitdown preprocessing

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages