File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,14 @@ def verify(self, poem: str | PoemStructure) -> VerificationResult:
160160
161161 if total_letters == 0 :
162162 lipogram_score = 0.0
163+ elif forbidden_count == 0 :
164+ lipogram_score = 1.0
165+ elif forbidden_count <= 2 :
166+ # Lenient for 1-2 mistakes: 1 -> 0.5, 2 -> 0.25
167+ lipogram_score = 0.5 ** forbidden_count
163168 else :
164- # Quadratic penalty for stricter GRPO training
165- linear_lipogram = 1.0 - (forbidden_count / total_letters )
166- lipogram_score = linear_lipogram ** 2
169+ # Binary after that - near zero
170+ lipogram_score = 0.05
167171
168172 # Combine scores
169173 score = line_result .score * 0.1 + lipogram_score * 0.9
@@ -238,10 +242,14 @@ def verify(self, poem: str | PoemStructure) -> VerificationResult:
238242
239243 if total_vowels == 0 :
240244 univocalic_score = 0.0
245+ elif wrong_vowels == 0 :
246+ univocalic_score = 1.0
247+ elif wrong_vowels <= 2 :
248+ # Lenient for 1-2 wrong vowels: 1 -> 0.5, 2 -> 0.25
249+ univocalic_score = 0.5 ** wrong_vowels
241250 else :
242- # Quadratic penalty for stricter GRPO training
243- linear_univocalic = correct_vowels / total_vowels
244- univocalic_score = linear_univocalic ** 2
251+ # Binary after that - near zero
252+ univocalic_score = 0.05
245253
246254 # Combine scores
247255 score = line_result .score * 0.1 + univocalic_score * 0.9
You can’t perform that action at this time.
0 commit comments