Apple's sentiment analysis thinks 'delete the temp file' is a death threat
NLTagger is Apple’s API for sentiment analysis. It’s integrated into iOS and macOS, runs on-device, needs no server, and is three lines of code away. It’s the first thing you find when searching for “sentiment analysis Swift”. Here’s what it returns for text any developer would write on a normal day: Message NLTagger Reality “delete the temp file” -0.8 Neutral instruction “ok” -0.8 Neutral confirmation “run make test” -0.6 Neutral instruction “commit and push” -0.4 Neutral instruction “great job, thanks!” +1.0 Positive (correct) “this is fucking broken” -1.0 Negative (correct) The scale goes from -1.0 (very negative) to +1.0 (very positive). According to Apple, “delete the temp file” carries almost the same emotional weight as “this is fucking broken”. And “ok” – the most neutral response in the English language – scores -0.8. ...