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

How we compare Cross-Sect Terms

CC0

Demo D 重現:並行雙鏈路 + 差異標註(正一 vs 全真 vs 閭山 vs 民間)。

跨派對照並行 RAGdiff

對應 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 asyncio, aiohttp

TERMS = ["三魂七魄", "五雷", "紫府"]
SECTS = ["正一", "全真"]

async def fetch(session, sect, term):
    async with session.post(
        "https://lius.cc/api/llm-rag",
        json={"q": f"{sect} {term}", "n": 3, "types": ["scripture", "concept", "paper"]},
    ) as r:
        r.raise_for_status()
        payload = await r.json()
        return sect, term, payload.get("hits", [])

async def main():
    async with aiohttp.ClientSession() as s:
        tasks = [fetch(s, sect, t) for t in TERMS for sect in SECTS]
        results = await asyncio.gather(*tasks)
        for sect, term, hits in results:
            print(f"\n[{sect}] {term}")
            for h in hits[:2]:
                print(f"  - {h['name']}")

# await main()

📜 本 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 索引

06 · How we compare Cross-Sect Terms · Cookbook · 鼎稔道學館