Skip to main content

apply_gating_to_answer

Function apply_gating_to_answer 

Source
pub fn apply_gating_to_answer(
    answer: &mut Answer,
    state: Option<&str>,
    question_id: Option<&str>,
    question: Option<&Question>,
    gating_config: Option<&GatingConfig>,
    calib_config: &CalibrationConfig,
)
Expand description

単一の判定結果 (Answer) に対し、解決されたゲーティング設定を適用する。

エネルギー値は None として処理されるため、OOD チェックを伴わない標準の確信度ゲーティングが行われる。 ロジットに基づく OOD 安全弁を有効化する場合は apply_gating_to_answer_with_energy または apply_gating_to_answer_with_logits を使用する。

§引数

  • answer: 判定結果 (可変参照)。
  • state: 文脈テキスト (プロンプト構築用、任意)。
  • question_id: 質問識別子 (プロンプト構築用、任意)。
  • question: 質問定義 (任意)。
  • gating_config: 明示的なゲーティング設定 (任意)。
  • calib_config: モデルのキャリブレーション設定。