Expand caption template variants to 20 per category#67
Conversation
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughBoth 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 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 45 minutes and 39 seconds.Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
templates/templates.jsontemplates/templates_hourly.json
♻️ 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
templates/templates.jsonandtemplates/templates_hourly.jsonto 20 variantswalking_activity,mind_body_activity, andother_activityto use{activity_name}instead of hardcoding "walking" / "yoga" / "another workout", matching the cardio / endurance / stationary pattern📚 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
weekly_hf_mini(sleep, walking, cardio, statistical, structural, semantic) — all parse with synthesizers without placeholder errorsjson.loadCode of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: