Skip to content

Commit 652bcad

Browse files
author
Fatih Dinc
committed
fix: combo penalty Conspiracy+Sensationalism reduces WiseScore to <0.1
1 parent a702718 commit 652bcad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

netlify/functions/validate/index.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ export default async (req: Request, _ctx: Context) => {
5656
const pen = AMP[amplification.toLowerCase()] ?? 1.0;
5757
const sg = tags(claim); const tp = 1 - sg.length * 0.06;
5858
const sc = sCon(claim); const ps = psi(claim);
59-
const t = Math.max(0.1, bt*pen*tp), c = Math.max(0.1, bc*(0.5+sc*0.5));
60-
const r = Math.max(0.1, br*ps), e = Math.max(0.1, be*pen);
59+
const comboFactor = (sg.includes("Conspiracy") && (sg.includes("Sensationalism") || sg.includes("Fear-Language"))) ? 0.12 : 1.0;
60+
const t = Math.max(0.1, bt*pen*tp*comboFactor), c = Math.max(0.1, bc*(0.5+sc*0.5)*comboFactor);
61+
const r = Math.max(0.1, br*ps), e = Math.max(0.1, be*pen*comboFactor);
6162
const ws = t*c*r*e;
6263
const R = (v:number) => Math.round(v*1000)/1000;
6364
return new Response(JSON.stringify({

0 commit comments

Comments
 (0)