Last active
May 11, 2026 08:12
-
-
Save Reithan/261e521b9ecdd792805fdb4fad45d404 to your computer and use it in GitHub Desktop.
STScript QR For Detecting and Rating AI Slop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /let slopFactor {: msg= mode=score | |
| /re-replace find=/’/gims replace="'" {{var::msg}} | | |
| /re-replace find=/[“”]/gims replace="\"" {{pipe}} | /var msg | //"| | |
| /let modes ["regex","fuzzy"] | | |
| /let patterns [ | |
| {"name":"em-dash","weight":10,"mode":"regex","pattern":"/—/gms"}, | |
| {"name":"slop-names","weight":3,"mode":"fuzzy","threshold":0.1,"pattern": | |
| ["Elara","Vance","Voss","Seraphina","Kael","Leo","Jax","Thalric","Lyra","Aerith","Kaelen","Sylas","Valerius", | |
| "Nova","Aurora","Zenith","Aether","Celeste","Seraphina", | |
| "Oliver","Emily","Sophia","Liam","Noah","Ava"]}, | |
| {"name":"science-eng-nerd","weight":3,"mode":"fuzzy","threshold":0.3,"pattern":["for science","experiment","variable","structural integrity","hypothesis","research purposes","density","resonance","frequency","standard","biology"]}, | |
| {"name":"slop-flavored","weight":3,"mode":"fuzzy","pattern":["ozone","vanilla","lavender","iridescent"]}, | |
| {"name":"white-knuckles","weight":1,"mode":"regex","pattern":"/((knuckles?\|(white\|tight)(e?n(ing\|ed)?)?)(\\w*\\W+){1,3}?){2,4}/gims"}, | |
| {"name":"pupils-blown","weight":1,"mode":"regex","pattern":"/((pupils?\|iris(es)?\|dilat(ed?\|ing)\|blown\|wide\|expand(ed)?\|gone\|vanish(ed)?)(\\w*\\W+){1,3}?){2,5}/gims"}, | |
| {"name":"physical-blow","weight":1,"mode":"regex","pattern":"/(like\|with\|as)((\\w*\\W+){1,3}?(physical\|actual\|real\|blow\|weight\|strike\|force\|slap\|punch\|tide\|wall\|shock)){2,}/gims"}, | |
| {"name":"youre-like-simile","weight":1,"mode":"regex","pattern":"/(you\|(s\|t\|)he(\|y\|ir)\|our)(\\w*\\W+){1,2}?(look\|seem\|feel\|smell\|taste\|act)(\\w*\\W+){1,2}?(like\|as if)(\\w*\\W+){0,6}/gims"}, | |
| {"name":"i-wont-bite","weight":1,"mode":"regex","pattern":"/i(\\w*\\W+){1,2}?(((w\|d)on't\|only\|never)(\\w*\\W+){1,2}?)?bite((\\w*\\W+){1,6}?(hard\|ask))?/gims"}, | |
| {"name":"rumble-pack","weight":1,"mode":"regex","pattern":"/((spine\|hip\|finger\|tail\|thigh\|shiver\|gyrate?\|rotate?\|drumm?\|vibrate?)(e?d\|ing)?(\\w*\\W+){1,3}?){2,}/gims"}, | |
| {"name":"its-not-a-its-b","weight":1,"mode":"regex","pattern":"/((s\|t\|)hey?\|it)(\\w*\\W+){1,3}(((wa\|i)s\|w(ere\|o)\|d(id\|o))?n('\|o)t)(\\w*\\W+){1,3}(just\|only\|soley?\|simpl(y\|e))(\\w*\\W+){1,3}\\1(\\w*\\W+){0,3}/gims"}, | |
| {"name":"is-that-a-penis","weight":1,"mode":"regex","pattern":"/((tension\|weight\|heat\|stiffness)(\\w*\\W+){1,6}?lower(\\w*\\W+){1,3}?(belly\|abdomen\|stomach))/gims"} | |
| ] | | |
| /segment granularity=sentence {{var::msg}} | /let sentences {{pipe}} | | |
| /let slopTokens 0 | /tokens {{var::msg}} | /let msgTokens {{pipe}} | /let hits [] | | |
| /foreach {{var::patterns}} {: pattern= idx= | |
| /ife pattern.mode == modes.0 {: | |
| /var index=pattern pattern | | |
| /re-exec find={{pipe}} {{var::msg}} | | |
| /foreach {{pipe}} {: | |
| /= item.0 | /trim | /let hit {{pipe}} | /tokens {{pipe}} | | |
| /= value = pipe * pattern.weight | /= slopTokens += value | | |
| /ife mode == 'hits' {: | |
| /= name = pattern.name | /= newIdx = hits.length | | |
| /replace pattern="\"" replacer="\\"" {{var::hit}} | //"| | |
| /var index={{var::newIdx}} as=object hits { | |
| "pattern":"{{var::name}}", | |
| "value":{{var::value}}, | |
| "hit":"{{pipe}}" | |
| } | | |
| :} | | |
| :} | | |
| :} | | |
| /elseif pattern.mode == modes.1 {: | |
| /var index=pattern pattern | /let words {{pipe}} | | |
| /foreach {{var::sentences}} {: sentence= sentenceId= | |
| /fuzzy list={{var::words}} threshold={: /= pattern.threshold or 0.2 | :}() mode=first {{var::sentence}} | | |
| /trim | /let match {{pipe}} | | |
| /ife match !== undefined {: | |
| /tokens {{var::match}} | | |
| /= value = pipe * pattern.weight | | |
| /= slopTokens += pipe | | |
| /ife mode == 'hits' {: | |
| /= name = pattern.name | /= newIdx = hits.length | | |
| /replace pattern="\"" replacer="\\"" {{var::sentence}} | //"| /trim | | |
| /var index={{var::newIdx}} as=object hits { | |
| "pattern":"{{var::name}}: {{var::match}}", | |
| "value":{{var::value}}, | |
| "hit":"{{pipe}}" | |
| } | | |
| :} | | |
| :} | | |
| :} | | |
| :} | | |
| :} | | |
| /switch {{var::mode}} | | |
| /case score {: /= 1 - (msgTokens / (msgTokens + slopTokens)) ** (2.5) | :} | | |
| /case hits {: /return {{var::hits}} | :} | | |
| /case {: /console-error [SlopFactor] Unknown mode: {{var::mode}} | /abort | :} | | |
| :} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment