Skip to content

Expand caption template variants to 20 per category#67

Merged
max-rosenblattl merged 4 commits into
mainfrom
max-rosenblattl/template-variants-20
May 1, 2026
Merged

Expand caption template variants to 20 per category#67
max-rosenblattl merged 4 commits into
mainfrom
max-rosenblattl/template-variants-20

Conversation

@max-rosenblattl

Copy link
Copy Markdown
Collaborator

♻️ Current situation & Problem

Most caption template lists (statistical, structural/trend, semantic, semantic_point, every cross_channel activity and metric pool) only had 5 variants — and the hourly cross_channel metric pools had just 2. With so few surface forms, training rows repeat phrasings often, which encourages the model to memorize the template structure rather than ground it in the underlying signal.

⚙️ Release Notes

  • Expand every template list in templates/templates.json and templates/templates_hourly.json to 20 variants
  • Refactor walking_activity, mind_body_activity, and other_activity to use {activity_name} instead of hardcoding "walking" / "yoga" / "another workout", matching the cardio / endurance / stationary pattern
  • Tune wording so weekly variants reference the week's mean (and minute/hour terminology stays consistent per file)

📚 Documentation

All new templates use only placeholders that already appear in the existing entries in each list, so no synthesizer changes were needed. The activity-name refactor lets one shared variant pool drive every "named activity" template instead of three near-identical pools.

✅ Testing

  • Each list verified at exactly 20 entries
  • Sample captions rendered against weekly_hf_mini (sleep, walking, cardio, statistical, structural, semantic) — all parse with synthesizers without placeholder errors
  • JSON files validated with json.load

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@max-rosenblattl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4c15fac2-3278-4b45-b076-12e1ad09b8b3

📥 Commits

Reviewing files that changed from the base of the PR and between 30dd849 and a0f0176.

📒 Files selected for processing (2)
  • templates/templates.json
  • templates/templates_hourly.json
📝 Walkthrough

Walkthrough

Both template files are expanded with new natural-language sentence variants across multiple categories including statistical, structural trend, semantic, and activity-related sections. Hardcoded activity terms in some templates are replaced with dynamic {activity_name} placeholders while maintaining consistent placeholder parameters throughout.

Changes

Cohort / File(s) Summary
Template Library Expansion
templates/templates.json, templates/templates_hourly.json
Added numerous new sentence variants across statistical, structural trend, semantic, and metric categories. Refactored structural.trend patterns and activity templates to use {activity_name} placeholder instead of hardcoded terms. Extended cross-channel metrics, sleep, and activity narrative coverage with additional phrasing alternatives while preserving placeholder parameters.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: expanding caption template variants to 20 per category, which matches the primary objective across both modified files.
Description check ✅ Passed The description is directly related to the changeset, providing context on the problem, release notes detailing the template expansions and refactoring, documentation, and testing verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch max-rosenblattl/template-variants-20

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 45 minutes and 39 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@templates/templates_hourly.json`:
- Around line 184-186: Several template strings hard-code an article before the
placeholder (e.g., "A {activity_name} activity was present…" and "A
{activity_name} session was detected…"), which breaks grammar for activity names
like "cycling" or "walking"; update all occurrences that contain "A
{activity_name}" or similar to remove the hard-coded article and make the phrase
article-agnostic (for example, change "A {activity_name} activity was present
from {time_unit} {start} to {end}{metrics_suffix}." to "{activity_name} activity
was present from {time_unit} {start} to {end}{metrics_suffix}." or rephrase to
"Detected {activity_name} activity from {time_unit} {start} to
{end}{metrics_suffix}."), and apply the same change to the other affected
template strings that include "{activity_name}" (including the session variant
and any duplicates).
- Around line 402-467: Replace inconsistent "week mean" phrasing with "week's
mean" (or "weekly mean" if appropriate) across the hr_day_delta_* caption
arrays; specifically update offending strings inside the "hr_day_delta_close",
"hr_day_delta_higher", and "hr_day_delta_lower" entries that currently read
"week mean" to "week's mean" so all user-facing captions use the same possessive
form (look for phrases like "the week mean of {day_mean:.0f}{day_mean_unit}" and
change them to "the week's mean of {day_mean:.0f}{day_mean_unit}").

In `@templates/templates.json`:
- Line 485: Several templates hard-code the indefinite article before the
{activity_name} placeholder (e.g., the string "An {activity_name} training block
spanned {time_unit} {start} to {end}{metrics_suffix}."); update those variants
to avoid a fixed "a/an" immediately before {activity_name} so the sentence is
grammatically correct for any activity. Find the affected template entries (the
lines containing "{activity_name} training block spanned" at the mentioned
locations) and rewrite them to either place the article after the placeholder
(e.g., "{activity_name} training block spanned..."), use a neutral phrasing that
omits the article (e.g., "Training block for {activity_name} spanned..."), or
restructure the sentence to not require an article; apply the same change to the
other listed occurrences (lines around 538-540 and 604-606) so no template
contains a hard-coded "a" or "an" directly before {activity_name}.
- Around line 204-269: In the templates for hr_day_delta_higher,
hr_day_delta_lower, and hr_day_delta_close replace the remaining phrases that
use the awkward "day mean" wording with "day's mean" or "daily mean" for
consistency (e.g., update entries like "The interval's {name} sat {delta:.0f}
{unit} above the day's {day_mean:.0f}{day_mean_unit} average", "The interval's
{name} sat {delta:.0f} {unit} below the day's {day_mean:.0f}{day_mean_unit}
average", and "The interval matched the day's average {name} of
{day_mean:.0f}{day_mean_unit}" to use "day's mean" or "daily mean" as
appropriate), ensuring all occurrences across
hr_day_delta_higher/hr_day_delta_lower/hr_day_delta_close are consistent with
the surrounding "day's mean" phrasing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7760d823-6f22-4ca9-9273-0c981155b69f

📥 Commits

Reviewing files that changed from the base of the PR and between d1dcdba and 30dd849.

📒 Files selected for processing (2)
  • templates/templates.json
  • templates/templates_hourly.json

Comment thread templates/templates_hourly.json
Comment thread templates/templates_hourly.json
Comment thread templates/templates.json
Comment thread templates/templates.json Outdated
@max-rosenblattl max-rosenblattl merged commit 1085683 into main May 1, 2026
3 checks passed
@max-rosenblattl max-rosenblattl deleted the max-rosenblattl/template-variants-20 branch May 1, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant