From 93087001f97658df26ce09effb440ef683e94ffd Mon Sep 17 00:00:00 2001 From: Linrador <68631622+Linrador@users.noreply.github.com> Date: Fri, 12 Jun 2026 09:21:35 +0200 Subject: [PATCH] updated rating --- backend/rating.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/backend/rating.go b/backend/rating.go index 5144447..012d95d 100644 --- a/backend/rating.go +++ b/backend/rating.go @@ -1348,6 +1348,7 @@ func computeHighlightRatingWithUsername(segments []aiSegmentMeta, durationSec fl var totalWeighted float64 var positionEffectiveWeighted float64 + var positionFlagged float64 var peakQuality float64 var longest float64 @@ -1395,6 +1396,7 @@ func computeHighlightRatingWithUsername(segments []aiSegmentMeta, durationSec fl continue } positionEffectiveWeighted += effectiveWeightedDur + positionFlagged += segDur if quality > peakQuality { peakQuality = quality @@ -1424,17 +1426,22 @@ func computeHighlightRatingWithUsername(segments []aiSegmentMeta, durationSec fl positionDensityNorm := ratingSoftCap(positionDensity, 5.5) coverageNorm := ratingSoftCap(weightedCoverageRatio, 0.20) longestNorm := ratingSoftCap(longest, 24.0) + positionDurationNorm := ratingSoftCap(positionFlagged, 45.0) confNorm := ratingSmoothStep((avgConfidence - 0.30) / 0.65) // Positionen dominieren. Kleidung/Objekte fließen durch Combo-Segment-Qualität (peakNorm) ein. + // Die Länge der erkannten Positionen wird bewusst stark gewichtet: + // längstes Positions-Segment (longestNorm) + Gesamtdauer aller Positionen (positionDurationNorm). + // Je länger eine Position erkannt wird, desto höher der Score. // Keine Penalties, keine Caps – die Formel bewertet natürlich nach Positions-Intensität. // Summe = 1.00. raw := - 0.42*positionDensityNorm + - 0.26*peakNorm + - 0.18*coverageNorm + - 0.08*longestNorm + - 0.06*confNorm + 0.34*positionDensityNorm + + 0.22*peakNorm + + 0.13*coverageNorm + + 0.16*longestNorm + + 0.11*positionDurationNorm + + 0.04*confNorm // Sehr wenig Material nicht überbewerten. if totalFlagged < 5.0 && n <= 1 { @@ -1469,13 +1476,14 @@ func computeHighlightRatingWithUsername(segments []aiSegmentMeta, durationSec fl r.AvgConfidence = ratingRound(avgConfidence, 3) appLogf( - "✅ %s rating score=%.1f stars=%d bonus=%.1f segs=%d flagged=%.1f posDensity=%.2f coverage=%.4f longest=%.1f avgConf=%.3f", + "✅ %s rating score=%.1f stars=%d bonus=%.1f segs=%d flagged=%.1f posFlagged=%.1f posDensity=%.2f coverage=%.4f longest=%.1f avgConf=%.3f", ratingLogSubject(username), r.Score, r.Stars, ratingRound(excellenceBonus*100, 1), r.Segments, r.FlaggedSeconds, + ratingRound(positionFlagged, 1), positionDensity, r.WeightedCoverageRatio, r.LongestSegmentSeconds,