Support negative feedback type#1215
Conversation
Design for issue gorse-io#848 - support explicit negative feedback with highest priority. Key features: - Add negative_feedback_types config option - Negative feedback takes priority over positive feedback - Backward compatible - no behavior change if not configured
Phase 1 of negative feedback priority implementation. - Add NegativeFeedbackTypes field to DataSourceConfig - Update Hash methods to include NegativeFeedbackTypes - Backward compatible: defaults to empty array
Phase 2 of negative feedback priority implementation. Changes: - Add negFeedbackTypes parameter to LoadDataFromDatabase - Load explicit negative feedback first (STEP 3) - Exclude negative feedback items from positive set (STEP 4) - Exclude negative/positive items from read set (STEP 5) - Create dataset with priority: negative > positive > read (STEP 6) The explicit negative feedback now has the highest priority: - Items with negative feedback are always treated as negative samples - Positive feedback on the same item is ignored - Read feedback on the same item is also ignored
…ndations Phase 3 of negative feedback priority implementation. Changes: - logics/recommend.go: Negative feedback items are always added to excludeSet regardless of EnableReplacement setting - cmd/gorse-cli/main.go: Add NegativeFeedbackTypes parameter to LoadDataFromDatabase calls This ensures items with explicit negative feedback are never recommended, even when replacement is enabled.
Phase 4 of negative feedback priority implementation. - Add comprehensive test for negative feedback priority - Tests user with both positive and negative feedback on same item - Verifies negative feedback takes priority in dataset creation - Verifies negative feedback items are excluded from recommendations - Update design document with implementation status
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1215 +/- ##
==========================================
- Coverage 73.18% 72.95% -0.23%
==========================================
Files 88 89 +1
Lines 16304 16569 +265
==========================================
+ Hits 11932 12088 +156
- Misses 3198 3242 +44
- Partials 1174 1239 +65 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds first-class support for explicit negative feedback types (configured via negative_feedback_types) and gives them highest priority during dataset construction and online recommendation exclusion, addressing the request in #244.
Changes:
- Extend recommendation data source config with
NegativeFeedbackTypesand include it in recommender/model digests. - Update dataset loading to treat explicit negative feedback as highest priority, and ensure it overrides positive/read samples.
- Update online exclusion logic so negative-feedback items are always excluded from recommendations (even when replacement is enabled).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| master/tasks.go | Loads explicit negative feedback first and applies priority rules when building CTR training samples. |
| logics/recommend.go | Always excludes items with configured negative feedback types from recommendations. |
| config/config.go | Adds negative_feedback_types to config and to hash/digest computations. |
| cmd/gorse-cli/main.go | Wires the new NegativeFeedbackTypes into CLI dataset loading. |
| master/tasks_test.go | Updates call sites for the new LoadDataFromDatabase signature and adds a priority/exclusion test. |
| docs/negative-feedback-design.md | Adds a design document describing negative feedback priority behavior and configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add 'Negative Feedback' section to data-source.md (English and Chinese) - Document negative feedback types with examples and warnings - Update configuration tables with negative_feedback_types - Update example configurations Related: gorse-io/gorse#1215
- Add Negative Feedback Types input field in RecFlow.vue - Load negative_feedback_types from API in Overview.vue - Include negative_feedback_types in feedbackTypes list in Recommend.vue Related: gorse-io/gorse#1215
Fix #244
Fix #848