as usual, built on top of previous PRs due to code dependencies.
this uses the requests python module to make a call to the perspective API for each post we insert in the DB. using jsonfield module, we store a python dictionary containing API probability scores.
for now, these are just displayed along with the post. we should discuss more how to format them nicely, if they should be turned be turned into tags, what probability thresholds to use, etc.
this also gets and stores the "span scores" (scores for particularly toxic or etc. substrings in the message) but I haven't done anything in terms of visualizing those selected spans. we might want to highlight them in the interface or something like that.
when you merge this in, first, you will need to do pip install -r requirements.txt to add the new packages. then, do an auto migration to add the perspective_data field. you must install the jsonfield package first since the new DB field uses it.
as usual, built on top of previous PRs due to code dependencies.
this uses the requests python module to make a call to the perspective API for each post we insert in the DB. using jsonfield module, we store a python dictionary containing API probability scores. for now, these are just displayed along with the post. we should discuss more how to format them nicely, if they should be turned be turned into tags, what probability thresholds to use, etc.
this also gets and stores the "span scores" (scores for particularly toxic or etc. substrings in the message) but I haven't done anything in terms of visualizing those selected spans. we might want to highlight them in the interface or something like that.
when you merge this in, first, you will need to do
pip install -r requirements.txt
to add the new packages. then, do an auto migration to add the perspective_data field. you must install the jsonfield package first since the new DB field uses it.