Twinkle HubTwinkle Hub

Keyword judicial full-text search

tw_search_judicial

Court rulings · same family🇹🇼 Taiwanread-only

關鍵字 / Keywords: 判決 法院 關鍵字檢索 court judgment 民事 刑事 行政 訴訟 verdict decision case

檢索台灣判決書 corpus — 關鍵字檢索.

用 jfull_contains 指定內文關鍵字, 可再用 court_code / year_from / year_to / jtitle_contains 縮小範圍. 常見詞 <1s, 中頻約 2s. 回傳含案由 / 判決日期 / 法院 / 命中段落摘錄.

⚠ 語意檢索(query 參數)暫停服務中 — 索引重整。給 query 會 回一則說明請你改用 jfull_contains; 若兩者都給, 會直接用關鍵字跑 並在回應中標註 semantic_skipped。不要因為想「找意思相近的」而 改送 query, 那不會生效 — 改成用幾個不同的關鍵字分別查比較有效.

資料涵蓋範圍看回應裡的 coverage 欄, 不要看這段說明 —— 兩層的 範圍差很多, 而手寫的說明會過期(2026-09-28 就是這樣被抓到:說明寫 「1.24M 案件 · 2025-042026-03」, 那是語意層的窗口, 而實際回答 查詢的關鍵字層是 1996 年起 2,200 萬件, 差 18 倍).

  • 關鍵字模式(jfull_contains): 我們語料的全部, 不等於司法院的全部. coverage.jdate_min / jdate_max / n_cases 是從實際被查的那張表算 出來的. 上游司法院是逐月出檔, 所以最新約到上個月底 —— 要查本月或 上月的裁判, 我們這裡不會有, 得去司法院裁判書系統(即時).
  • 語意模式(query): 只涵蓋最近 12 個月的嵌入窗口, 且目前停用.

⚠ 不要用 jfull_contains 查日期字串. 判決書的日期行長這樣: 中 華 民 國 八十五 年 一 月 二十九 日 —— 字與字之間有多個空白, 而且是中文數字(不是 115 / 2). 所以 jfull_contains="中華民國115年2月" 一定是 0 筆, 那是格式問題不是沒資料. 要限日期一律用 year_from / year_to(比對 jdate, 西元年).

⚠ 關鍵字檢索(jfull_contains)的結果不是「最新的前 N 筆」, 也不是 「最相關的前 N 筆」.(語意檢索開放時, query 那條路依相似度排序, 不適用這段.)命中很多時, 回哪幾筆是固定、可重現的, 但不依日期或相關度挑選; 拿回來的這一頁再 依法院層級(高→低)、同層依年份(新→舊)排列 —— 所以同一頁會看到 2003 與 2026 的判決並列. 即使整頁看起來依年份新→舊排列(例如全是同一層 法院), 也只是這一頁內的順序, 不代表它們是最新的判決. 要近期判決請加 year_from / year_to(西元年).

⚠ 問不出「昨天新上網幾筆」. 語料只有裁判日期(jdate), 沒有 司法院的上架日期; 上游月更檔本身就不含後者. 要「昨天新上網」只能 去司法院裁判書系統查. 另外用 jdate 算單日在週末通常接近 0 筆.

Args: query: 自然語言, 例「鋰電池產品瑕疵糾紛」「對勞工通勤受傷的判決」. 省略則走純關鍵字模式(此時 jfull_contains 必填) jtitle_contains: 案由硬性過濾 jfull_contains: 內文必含此關鍵字. 單獨使用(不給 query)即為 關鍵字模式; 與 query 並用則是語意檢索前的硬性過濾 court_code: 4 碼法院代碼 (從 jid 取, 如 CPEV/TPSV) case_type: 民事/刑事/行政/憲法/懲戒/家事(依判決字號的類別字)· 少年事件依法不公開,給了會報錯 year_from/year_to: jdate 西元年範圍 (e.g. 2024-2026) winner: T3 抽出的勝訴方 ⚠ 同上,只在語意模式 ⚠ 僅對已 T3-processed 月份有效 outcome_type: T3 抽出的結果 ⚠ 同上,只在語意模式 ⚠ 同上 limit: top-K 件 (1-100, 預設 20)

Returns: hits: 關鍵字模式(現行)每筆含 jid/best_chunk_idx/best_chunk_excerpt, 有的話再加 jtitle/jdate/court_code/jpdf 與 T3 的 issue/outcome_type/ winner/award_amount/sentence. similarity/has_t3/key_reasoning 只在語意模式(停用中)才有. timed_out / error: 全文掃描逾時且沒有任何結果時回 timed_out=true,並附 error.code="tool_timeout"(retryable=false:原樣重試會再逾時;這次不計點數)。 這不代表查無結果,請改用更具體的關鍵字或加 year_from / court_code 再查。

Parameters

ParamTypeDescription
querystring—
jtitle_containsstring—
jfull_containsstring—
court_codestring—
case_typestring—
year_frominteger—
year_tointeger—
winnerstring—
outcome_typestring—
limitinteger—
Raw JSON schema
{
  "properties": {
    "query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Query"
    },
    "jtitle_contains": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Jtitle Contains"
    },
    "jfull_contains": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Jfull Contains"
    },
    "court_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Court Code"
    },
    "case_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Case Type"
    },
    "year_from": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Year From"
    },
    "year_to": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Year To"
    },
    "winner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Winner"
    },
    "outcome_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Outcome Type"
    },
    "limit": {
      "default": 20,
      "title": "Limit",
      "type": "integer"
    }
  },
  "title": "tw_search_judicialArguments",
  "type": "object",
  "additionalProperties": false
}

How to call

Starter — params in the table above
tw_search_judicial({ query: "…" })