Coder Social home page Coder Social logo

spicypen1992 / discourse-perspective-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from discourse/discourse-perspective-api

0.0 0.0 0.0 419 KB

Google Perspective API Plugin for Discourse

License: MIT License

JavaScript 18.73% Ruby 80.69% Handlebars 0.58%

discourse-perspective-api's Introduction

Discourse Perspective plugin

https://meta.discourse.org/t/google-perspective-api-plugin/98733

This plugin flags toxic posts using Google's Perspective API.

Installation

Follow the directions at Install a Plugin using https://github.com/discourse/discourse-perspective-api.git as the repository URL.

Authors

Erick Guan

License

GNU GPL v2

Data Explorer Queries

If you choose standard mode, use post_perspective_toxicity. Otherwise, replace them to post_perspective_severe_toxicity. For most toxic categories and users, I choose a probability 0.85 as the threshold.

Most toxic categories:

SELECT COUNT(pc) as counts, c.id, c.name, c.description
FROM post_custom_fields pc
JOIN posts p ON p.id = pc.post_id
JOIN topics t ON t.id = p.topic_id
JOIN categories c ON c.id = t.category_id
WHERE pc.name = 'post_perspective_toxicity' AND pc.value >= '0.85'
GROUP BY c.id
ORDER BY counts DESC
LIMIT 100

Most toxic users:

SELECT COUNT(pc) as counts, u.id, u.username, u.trust_level, u.suspended_till, u.silenced_till
FROM post_custom_fields pc
JOIN posts p ON p.id = pc.post_id
JOIN users u ON p.user_id = u.id
WHERE pc.name = 'post_perspective_toxicity' AND pc.value >= '0.85'
GROUP BY u.id
ORDER BY counts DESC
LIMIT 100

Most toxic posts:

SELECT p.id, pc.value, p.user_id, p.topic_id, p.created_at, p.raw
FROM post_custom_fields pc
JOIN posts p ON p.id = pc.post_id
WHERE pc.name = 'post_perspective_toxicity'
ORDER BY pc.value DESC
LIMIT 100

Most toxic posts today:

SELECT p.id, pc.value, p.user_id, p.topic_id, p.created_at, p.raw
FROM post_custom_fields pc
JOIN posts p ON p.id = pc.post_id
WHERE pc.name = 'post_perspective_toxicity' AND
p.created_at >= CURRENT_DATE
ORDER BY pc.value DESC
LIMIT 100

discourse-perspective-api's People

Contributors

erickguan avatar discourse-translator-bot avatar discoursebot avatar samsaffron avatar dependabot[bot] avatar jjaffeux avatar justindirose avatar rishabhnambiar avatar romanrizzi avatar martin-brennan avatar pmusaraj avatar cvx avatar davidtaylorhq avatar markvanlan avatar erlend-sh avatar gschlager avatar tgxworld avatar janzenisaac avatar lis2 avatar osamasayegh avatar xscorpion2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.