MediaPipeTasksDecision Framework Reference

BooleanQuestion

public struct BooleanQuestion : Sendable, Equatable

Configuration for evaluating a natural-language boolean predicate.

  • Natural-language condition statement to evaluate as true or false.

    Declaration

    Swift

    public var condition: String
  • Probability threshold in [0.0, 1.0] above which BooleanResult.value is true.

    Declaration

    Swift

    public var threshold: Float
  • Softmax temperature override (0.0 uses the model's calibrated default).

    Declaration

    Swift

    public var temperature: Float
  • Whether to subtract the empty-context prior log-odds before thresholding.

    Declaration

    Swift

    public var normalizePrior: Bool
  • Creates a new BooleanQuestion.

    Declaration

    Swift

    public init(condition: String, threshold: Float = 0.5, temperature: Float = 0.0, normalizePrior: Bool = false)