sensorlm-rs 0.1.0

SensorLM – wearable sensor foundation model in Rust (Burn + WGPU)
Documentation
//! Text templates for all three captioning levels.
//!
//! Each constant is a slice of format-string templates.  A random template is
//! chosen at generation time so the model sees linguistic diversity in the
//! training text rather than identical phrasing for every sample.

// ---------------------------------------------------------------------------
// Level 1 – Statistical (low-level) templates
// Placeholders: {name}, {mean_val:.1}, {max_val:.1}, {min_val:.1}, {std_val:.1}
// ---------------------------------------------------------------------------

/// Templates that describe per-channel statistics (mean, max, min, std).
pub const LOW_LEVEL_TEMPLATES: &[&str] = &[
    "{name} mean, max, min, std are {mean_val:.1}, {max_val:.1}, {min_val:.1}, {std_val:.1}.",
    "{name} exhibits a mean of {mean_val:.1}, with peak and minimal values reaching {max_val:.1} and {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} shows a mean of {mean_val:.1}, with range {max_val:.1} to {min_val:.1} and a standard deviation of {std_val:.1}.",
    "{name} metrics include a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} has a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} displays a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} presents a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} reports a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "{name} average {mean_val:.1}, reaching a maximum of {max_val:.1} and a minimum of {min_val:.1}, with a standard deviation of {std_val:.1}.",
    "{name} features a mean of {mean_val:.1}, a maximum of {max_val:.1}, a minimum of {min_val:.1}, and a standard deviation of {std_val:.1}.",
    "The average {name} value is {mean_val:.1}, with extremes at {max_val:.1} (max) and {min_val:.1} (min), and a std of {std_val:.1}.",
    "Statistical overview of {name}: mean = {mean_val:.1}, max = {max_val:.1}, min = {min_val:.1}, standard deviation = {std_val:.1}.",
    "{name} data summary: average = {mean_val:.1}, highest point = {max_val:.1}, lowest point = {min_val:.1}, standard deviation = {std_val:.1}.",
    "The {name} readings show a central value of {mean_val:.1}, a standard deviation of {std_val:.1}, and a value range of {min_val:.1}–{max_val:.1}.",
    "Observed statistics for {name}: mean of {mean_val:.1}, standard deviation of {std_val:.1}, with values ranging from {min_val:.1} to {max_val:.1}.",
    "The {name} sensor data has a mean of {mean_val:.1}, a standard deviation of {std_val:.1}, and its values fluctuate between {min_val:.1} and {max_val:.1}.",
    "For the {name} measurements, the mean is {mean_val:.1}, the standard deviation is {std_val:.1}, and the data lies between {min_val:.1} and {max_val:.1}.",
    "A summary of {name} data reveals a mean of {mean_val:.1}, a standard deviation of {std_val:.1}, a minimum of {min_val:.1}, and a maximum of {max_val:.1}.",
    "The {name} values are characterized by a mean of {mean_val:.1}, a standard deviation of {std_val:.1}, and a range from {min_val:.1} to {max_val:.1}.",
    "The {name} data exhibits a mean of {mean_val:.1}, a standard deviation of {std_val:.1}, and its extreme values are {min_val:.1} and {max_val:.1}.",
];

// ---------------------------------------------------------------------------
// Level 2 – Structural (trend) templates
// Placeholders: {sensor_name}, {trend_type}, {start}, {end}
// ---------------------------------------------------------------------------

/// Templates that describe temporal trends within a sensor channel.
pub const TREND_TEMPLATES: &[&str] = &[
    "From minute {start} to {end}, {sensor_name} exhibits an {trend_type} trend.",
    "{sensor_name} is observed to be {trend_type} between minute {start} and {end}.",
    "During minute {start} to {end}, there is a {trend_type} trend in {sensor_name}.",
    "Data from {sensor_name} indicates a {trend_type} trend spanning minute {start} to {end}.",
    "{sensor_name} reveals an {trend_type} trend during the interval of minute {start} to {end}.",
    "{sensor_name} is {trend_type} throughout the period from minute {start} to minute {end}.",
    "Over minute {start} to {end}, {sensor_name} displays a {trend_type} trend.",
    "An {trend_type} trend in {sensor_name} data recorded between minute {start} and {end}.",
    "{sensor_name} undergoes an {trend_type} trend in the time window of minute {start} to {end}.",
    "{sensor_name} is {trend_type} between minutes {start}-{end}.",
    "During the period of minute {start} to {end}, {sensor_name} is {trend_type}.",
    "Observing a {trend_type} trend in {sensor_name} across minutes {start} to {end}.",
    "{trend_type} trend in {sensor_name} observed between minutes {start} and {end}.",
    "{sensor_name} exhibits {trend_type} trend during minute {start}-{end} interval.",
    "The {sensor_name} trend from minute {start} to {end} is {trend_type}.",
];

// ---------------------------------------------------------------------------
// Level 2 – Anomaly (peak/valley) templates
// Placeholders: {sensor_name}, {anomaly}, {time}
// ---------------------------------------------------------------------------

/// Templates that describe significant peaks, spikes, or drops in a signal.
pub const ANOMALY_TEMPLATES: &[&str] = &[
    "A {anomaly} is detected for {sensor_name} at minute {time}.",
    "At minute {time}, {sensor_name} shows a {anomaly}.",
    "We observe a {anomaly} in {sensor_name} data at minute {time}.",
    "Minute {time} shows a {anomaly} for the {sensor_name}.",
    "The {sensor_name} experienced a {anomaly} at minute {time}.",
    "A {anomaly} is recorded for {sensor_name} at minute {time}.",
    "A {anomaly} occurs in the {sensor_name} readings at minute {time}.",
    "Data indicates a {anomaly} for {sensor_name} at the {time}-minute mark.",
    "A {anomaly} observed in {sensor_name} at minute {time}.",
    "{sensor_name} displays a {anomaly} at minute {time}.",
    "Irregular {anomaly} in {sensor_name} readings at minute {time}.",
    "At minute {time}, an {anomaly} is present in {sensor_name}.",
    "Unusual {anomaly} in {sensor_name} data at minute {time}.",
    "Noteworthy {anomaly} for {sensor_name} at minute {time}.",
    "{anomaly} event recorded for {sensor_name} at minute {time}.",
];

// ---------------------------------------------------------------------------
// Level 3 – Semantic (activity) templates
// Placeholders: {activity}, {start_minute}, {end_minute}
// ---------------------------------------------------------------------------

/// Templates that describe a labelled activity event.
pub const ACTIVITY_TEMPLATES: &[&str] = &[
    "{activity} during minutes {start_minute} to {end_minute}.",
    "{activity} between minutes {start_minute} and {end_minute}.",
    "{activity} was detected between minutes {start_minute} and {end_minute}.",
    "A {activity} event was detected between minutes {start_minute} and {end_minute}.",
    "A {activity} period between minutes {start_minute} and {end_minute}.",
    "{activity} occurred from minute {start_minute} to {end_minute}.",
    "Observed {activity} spanning minutes {start_minute} to {end_minute}.",
    "{activity} was recorded between minute {start_minute} and {end_minute}.",
    "Period of {activity} noted from minute {start_minute} until {end_minute}.",
    "{activity} took place during the minutes {start_minute} through {end_minute}.",
    "Identified {activity} across the timeframe of minute {start_minute} to {end_minute}.",
    "{activity} is indicated between the {start_minute} and {end_minute} minute marks.",
    "An instance of {activity} was identified from minute {start_minute} to {end_minute}.",
    "{activity} state observed from minute {start_minute} up to {end_minute}.",
    "User engaged in {activity} between minute {start_minute} and {end_minute}.",
    "A continuous {activity} phase from minute {start_minute} to {end_minute}.",
    "{activity} episode occurred between minute {start_minute} and {end_minute}.",
    "From minute {start_minute} to {end_minute}, the user had a period of {activity}.",
    "Detection of {activity} activity between minute {start_minute} and {end_minute}.",
    "{activity} recorded within the {start_minute}-{end_minute} minute range.",
];

// ---------------------------------------------------------------------------
// Level 3 – Mood templates
// Placeholders: {mood}, {time}
// ---------------------------------------------------------------------------

/// Templates that describe a self-reported mood log entry.
pub const MOOD_TEMPLATES: &[&str] = &[
    "The person logged their mood as {mood} at minute {time}.",
    "A mood of {mood} was logged at minute {time}.",
    "Mood appears to be {mood} at minute {time}.",
    "At minute {time}, the person's mood is {mood}.",
    "Feeling {mood} was reported by the individual at minute {time}.",
    "The individual feels {mood} at minute {time}.",
    "Reported {mood} mood at minute {time} for the individual.",
    "The person registered a mood of {mood} at minute {time}.",
    "At minute {time}, the individual's feeling is {mood}.",
    "At minute {time}, the person logs their mood as {mood}.",
];