feat(profiler/behave_shell): G.8 emotional_valence.frustration_venting
Binary read of ctx.obscenity_hits (G.0 lexical counter): * detected — obscenity_hits ≥ 1 * none — zero hits Skip below FRUST_VENT_MIN_TYPED_CHARS (30). Confidence hard-capped at 0.5: 0.40 when detected, 0.50 only when cleanly absent over ≥ 200 typed letters, 0.30 otherwise.
This commit is contained in:
@@ -26,6 +26,7 @@ from decnet.profiler.behave_shell._features.cognitive import (
|
||||
)
|
||||
from decnet.profiler.behave_shell._features.emotional_valence import (
|
||||
arousal,
|
||||
frustration_venting,
|
||||
stress_response,
|
||||
valence,
|
||||
)
|
||||
@@ -99,4 +100,5 @@ FEATURES: tuple[FeatureFn, ...] = (
|
||||
valence,
|
||||
arousal,
|
||||
stress_response,
|
||||
frustration_venting,
|
||||
)
|
||||
|
||||
@@ -26,6 +26,8 @@ from decnet.profiler.behave_shell._thresholds import (
|
||||
AROUSAL_FAST_IAT_S,
|
||||
AROUSAL_MIN_IATS,
|
||||
EMOTIONAL_VALENCE_CONFIDENCE_CAP,
|
||||
FRUST_VENT_FULL_CONFIDENCE_MIN,
|
||||
FRUST_VENT_MIN_TYPED_CHARS,
|
||||
STRESS_DISTRESS_RATIO_MIN,
|
||||
STRESS_EUSTRESS_RATIO_MIN,
|
||||
STRESS_MIN_ERRORED_WITH_IATS,
|
||||
@@ -186,3 +188,36 @@ def stress_response(ctx: SessionContext) -> Iterator[Observation]:
|
||||
value=value,
|
||||
confidence=_cap_soft(raw),
|
||||
)
|
||||
|
||||
|
||||
def frustration_venting(ctx: SessionContext) -> Iterator[Observation]:
|
||||
"""Emit ``emotional_valence.frustration_venting`` ∈ {none, detected}.
|
||||
|
||||
Pure read of ``ctx.obscenity_hits`` (G.0 lexical counter):
|
||||
|
||||
* ``detected`` — ``obscenity_hits ≥ 1``.
|
||||
* ``none`` — zero hits.
|
||||
|
||||
Skip emission below ``FRUST_VENT_MIN_TYPED_CHARS`` (30) typed
|
||||
letters — too thin to call cleanly absent. Confidence hard-capped
|
||||
at 0.50; 0.40 when ``detected``; 0.50 only when ``none`` AND
|
||||
typed_letter_count ≥ ``FRUST_VENT_FULL_CONFIDENCE_MIN`` (200);
|
||||
0.30 otherwise.
|
||||
"""
|
||||
if ctx.typed_letter_count < FRUST_VENT_MIN_TYPED_CHARS:
|
||||
return
|
||||
if ctx.obscenity_hits >= 1:
|
||||
value = "detected"
|
||||
raw = 0.40
|
||||
else:
|
||||
value = "none"
|
||||
if ctx.typed_letter_count >= FRUST_VENT_FULL_CONFIDENCE_MIN:
|
||||
raw = 0.50
|
||||
else:
|
||||
raw = 0.30
|
||||
yield make_observation(
|
||||
ctx,
|
||||
primitive="emotional_valence.frustration_venting",
|
||||
value=value,
|
||||
confidence=_cap_soft(raw),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user