File size: 394 Bytes
345855e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | def predict_retention(words):
if not words:
return 0
duration = words[-1]["end"] - words[0]["start"]
score = 100
# too long → drop-off risk
if duration > 30:
score -= 30
# too short → no engagement
if duration < 6:
score -= 20
# weak opening signal
if "..." in words[0]["text"]:
score -= 10
return max(0, score) |