Eh, AI is pretty shit at NLP still. It can summarize text and other things, but it's really bad at reading intent and sentiment, as most of that is just word encoding under the covers, which is honestly a shitty way to do it given vernacular changes etc. You'd also need to build historical models of people's speech or output and compare against that as a baseline. More likely to have lots of false-positives. This is why regulatory and societal fixes are much better. Pointing cops (who have their own violence issues) at "potential" school shooters is going to just end up with more innocent dead kids, just through a different mechanism.
Restricting access, putting waiting periods in and doing things like perhaps Israel does around firearms where they incorporate mental health checks and training would be the right way to do it while not unduly restricting those who still want to engage in hunting or other activities (
https://www.gov.il/en/Departments/Ge...ng-information)