Skip to main content

generate_caption

Function generate_caption 

Source
pub fn generate_caption<R: Rng>(
    x_norm: &ArrayView2<'_, f64>,
    mask: Option<&Array2<u8>>,
    ctx: &CaptionContext,
    key: CaptionKey,
    rng: &mut R,
) -> Result<String>
Expand description

Generate the caption text for the requested CaptionKey.

§Arguments

  • x_norm – Z-score normalised sensor tensor, shape (1440, C).
  • mask – Optional missingness mask (1 = imputed), same shape as x_norm.
  • ctx – Semantic context (activities, sleep, moods).
  • key – Which caption variant to produce.
  • rng – Random number generator for template selection.