鼎稔道學館
← 開源 LLM/Cookbook/03
03

How we read the Canon (道德經三欄)

CC0

Demo #5 完整重現:原文(王弼本,公眾領域)+ 白話翻譯(館內 CC0)+ 即時 RAG 注釋。

經文白話對讀RAG三欄式

對應 Live Demo

🔒 重現條件鎖
MODEL    = "lius-cc/Daoism-Qwen3.5-9B"
DATASET  = "lius-cc/daoism-knowledge-rag@v1"
RAG_API  = "https://lius.cc/api/llm-rag"
SNAPSHOT = "2026-05-17"

概念

原文 + 白話 + 動態注釋查詢,是學者跑古典文獻最小工作流。

import requests

CHAPTERS = {
    1:  "道可道,非常道。名可名,非常名。無,名天地之始;有,名萬物之母。",
    2:  "天下皆知美之為美,斯惡已;皆知善之為善,斯不善已。故有無相生,難易相成。",
    11: "三十輻共一轂,當其無,有車之用。",
    33: "知人者智,自知者明。勝人者有力,自勝者強。",
    81: "信言不美,美言不信。善者不辯,辯者不善。",
}

def fetch_commentary(chapter_num: int, original: str):
    q = f"道德經 第{chapter_num}章 {original[:8]} 王弼 河上公"
    res = requests.post(
        "https://lius.cc/api/llm-rag",
        json={"q": q, "n": 5, "types": ["scripture", "concept", "paper"]},
        timeout=10,
    )
    res.raise_for_status()
    return res.json().get("hits", [])

for num, text in CHAPTERS.items():
    print(f"\n=== 第 {num} 章 ===")
    print(f"原文:{text}")
    hits = fetch_commentary(num, text)
    for h in hits[:3]:
        print(f"  ▸ [{h['type']}] {h['name']} (score {h['score']})")

📜 本 recipe 採 CC0 1.0 · 改一行 prompt → 寫到論文裡 → 引用 LIUS API

引用建議:We use the open-source Daoism-Qwen3.5-9B with the public RAG API at https://lius.cc/api/llm-rag (Liu & Dingren Daoxue Lab, 2026).

← 回 Cookbook 索引

03 · How we read the Canon (道德經三欄) · Cookbook · 鼎稔道學館