Perspective Plugin: Issues with perspective scores

AI-generated summary

Terrapop reports mixed success with the Perspective Plugin: it successfully flags toxic posts for moderation and alerts users, but encounters two key issues. First, the plugin only functions if the Google API key isn’t restricted by HTTP referrer in the Google Developer Console — otherwise, it returns empty responses. Second, no perspective scores are being saved to the post_custom_fields database table, even though Sidekiq is running and the Jobs::InspectToxicPost job is visible. Terrapop later clarifies that this may stem from a design limitation: the plugin’s settings imply that live toxicity checking and backfilling scores to the database are mutually exclusive modes. They express disappointment, as they hoped to use the scores to dynamically suppress banner ads on toxic content — a feature that worked well on their previous site and aligns with Google’s own Adsense policies. They suggest adding an option to save scores (especially those exceeding thresholds) even during live checking. A deprecation warning is also noted in the logs: PostAction.act is deprecated and should be replaced with PostActionCreator Terrapop.

Just installed the plugin.

Don’t see any double posts issues.

And it notifies me when I want to post something bad. Also the post is flagged for moderation review.

However, some issues so far.

a) The plugin only works when I don’t restrict the api key to certain HTTP referrer in the Google developer console. Otherwise an empty response is returned by Google.

b) The plugin does not create any entries in post_custom_fields in the data base with the scores.

When I run…

SELECT * FROM post_custom_fields
ORDER BY created_at DESC
LIMIT 100

I don’t see any new entries with perspective scores.

Sidekiq is running and I see Jobs::InspectToxicPost.

Any suggestions why is that?

Regarding b)

Is that maybe a misunderstanding, because in the setting it reads:

Query the toxicity of existing posts and record the results in post custom fields; This mode disables live checking for posts.

Does this mean I can only do either live checking or backfilling? Looks like.

That’s too bad because we wanted to use the scores to check if a topic/posts on the page is too toxic to show banner ads.

Why is there not an option to have live checking AND immediately saving the results (at least if they break the thresholds) to the database if a user chooses to continue anyways?

That’s how we did it on our old website and as Google Perspective is a service by Google it works very well with Adsense (to avoid getting flagged for disallowed content on the page).

deprecation notice: PostAction.act is deprecated. Use PostActionCreatorinstead. At /var/www/discourse/plugins/discourse-perspective-api/lib/discourse_perspective.rb:73:inflag_on_scores`