1
0
Fork 0
forked from lthn/LEM
Commit graph

3 commits

Author SHA1 Message Date
Snider
41d8008e69 fix: expand emotional_register to include distress, anger, fear vocabulary
The emotional register scorer only matched positive/neutral emotions
(joy, compassion, tender, etc.) and completely missed negative human
expressions (angry, furious, devastated, terrified, bleeding, screaming).

This caused a real Reddit AITA post about a distressed mother to score
emotional_register=1 despite containing "screaming in pain", "pooping
blood", and "blind rage", leading to a false ai_generated verdict.

Changes:
- Add 4 new pattern groups: distress/anger, sadness/despair, fear/anxiety,
  physical distress (~40 new vocabulary words)
- Switch from int count to weighted float64 scoring — intensity groups
  (vulnerability, distress, physical) score 1.5-2.0x per match vs 1.0x
  for common emotion words
- Round to 1 decimal place, cap at 10.0
- Update tests with distress/anger/physical cases including the Reddit
  failure case from calibration findings

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-02 22:02:34 +00:00
Snider
e982911939 fix: normalise LEK score to 0-100 via tanh sigmoid
Raw weighted sums ranged -25..+20, causing all text to land below the
ai_generated threshold (< 25). Now 50 = neutral (no signal), negatives
push toward 0 (AI markers), positives push toward 100 (human markers).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-26 06:32:24 +00:00
Snider
0e11c4487f refactor: extract pkg/heuristic subpackage for CGO-free scoring
Move HeuristicScores type and ScoreHeuristic logic into pkg/heuristic
with zero external deps (stdlib only). pkg/lem delegates via type alias
and wrapper function — fully backward compatible. Enables EaaS to
cross-compile for Linux without dragging in go-ml/go-mlx/go-duckdb.

Also adds missing //go:build tag to backend_mlxlm.go.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-26 04:34:18 +00:00