Host safer conversations with Perspective API
Skills:
AI Ethics & Policy80%
Key Takeaways
Perspective API is a free API that helps host better conversations online by limiting toxic discourse
Full Transcript
hey there i'm ben morse i'm a developer advocate at google where i work to make the web better for users and developers alike people should be able to engage in authentic discussions on the web without fear that's why the web was created toxic comments and harassment shouldn't silence people's voices and yet unfortunately this can be a problem that's why i was so excited to discover perspective perspective is a free api that helps you host better conversations online by limiting toxic discourse i think it's good for the web and i want to help you get started with it so first we'll talk about what perspective api is and then i'll show you how to set it up so what is perspective api perspective was created by the conversation ai initiative which is a collaboration between jigsaw and the counter abuse technology team at google conversation ai uses machine learning to fight online toxicity and harassment perspective uses machine learning models to analyze online comments guess the impact they might have in a conversation and assign each's score it can help you keep conversations civil on your site so you feel safe to share your voice with the world the api works with languages like english spanish french german portuguese and italian perspective scores comment on a set of attributes these attributes determine whether a comment might be toxic threatening insulting or simply off topic toxicity is the most popular attribute the site defines it as a rude disrespectful or unreasonable comment that is likely to make you leave the discussion here's an example someone reads an article on your site and makes the comment shut up you're an idiot before your site publishes this comment it gets fed through the perspective api perspective runs it through its models and scores it on attributes like toxicity insults and profanity returning some pretty high scores toxicity is 0.99 insult is 1.0 the maximum this is a comment you're likely to reject now you're probably wondering whether perspective is right for you here are some common use cases many sites use perspective to flag potentially harmful comments so a moderator can check them before they get posted for example perspective power is the tool used by moderators at the new york times coral by vox media uses perspective in the same way to curb online harassment in their comment sections and perspective is also available in plugins for discourse and for wordpress you can also make your own discord bot like dale markowitz did in this video beyond moderation you can also help commenters in real time by warning them that a comment might violate your community guidelines or could be perceived as toxic here when i type you're dumb the site warns me that this might well be toxic and recommends that i edit the comments when i change it to you're nice it's non-toxic finally you can let readers filter comment sections to hide potentially harmful comments perspective powers a chrome extension called tune which helps people see fewer toxic comments across the web these are the most common use cases but people use the ipi in all kinds of creative ways for example audiobond uses speech-to-text to transcribe audio and check the transcription for toxic content while perspective is pretty smart you're not going to want to use it for fully automated moderation any machine learning models can make mistakes that a human wouldn't instead it's better to use perspective to flag comments for a human to review think of it as a time saver for more information about how to use or not use perspective check out the best practices and risks on the site now let's get started i'll walk you through the steps you'll need to get perspective api up and running perspective runs on google cloud to use it you'll need a google account and you'll need to set up a cloud project google cloud is a set of cloud computing services that runs on google's infrastructure it's a good place to host a reliable api to get started make sure you've logged in with or created a google account then go to the cloud console page at console.cloud.google.com to use a google cloud service you need to enable it within a google cloud project you can choose or create a project with a drop down on top of the page right near the words google cloud platform if you've already got a project this drop down will display the project's name if you haven't the drop down will say select a project in either case click this drop down you'll then see a pop-up showing your existing projects if you have any plus a button that says new project if you want to use an existing project do that or to create a new project click new project in the pop-up give the project whatever name you like make note of the project id that appears under the name as you'll need this to identify your project later on now click the create button and there it is our brand new google cloud project click view and we're in our project now that we have our project set up in google cloud we need to request access to the api we'll do this on the prospective api site so let's fill out the form and then we wait within an hour they're probably a lot less you should get a confirmation email look here's my confirmation now now we can enable the api there's two ways to do this way number one click on the link in the email that'll lead you back to the api's page in the google developers site visit the prospective api overview page click enable choose your project and you're done way number two if you like using the command line and you've already installed the google cloud sdk type gcloud services enable commentanalyzer.googleapis.com finally we need to generate an api key to authenticate our requests this key is our own private code unique to us a secret token for our cloud api if you're already on the credentials page as we are click api key on the next page choose a name for your api key for security it's best to set some application restrictions in the interface click create and you're done you can also go to the google api credentials page and click create credentials then click choose api key in the credentials drop down of course you make requests from client-side javascript on your website people will be able to discover your api key so it's best to store your api key safely on your server and proxy requests through your own web service your api key should begin working in a few minutes although it could take up to an hour once it's ready you can copy your api key and get to work to learn how to use the api itself go to the prospective developer sites if you want to get started quickly the methods page describes how to use the two methods analyze comment and suggest comments score by default the api has a quota limit of about 60 queries for 60 seconds this is plenty for testing for small publishers like me i'm looking at lego 60 comments in a year if you need more quota request it on the developer's site when you do your first tests just send one comment to be on the safe side as you use the api don't batch up comments the big groups may hit your quota limits it may even be safe to send each comment with a small delay like this that's it if you missed anything go to that developer's site where you'll find the get started instructions sample use cases how you can contribute feedback to help improve the machine learning models if you're concerned about data and privacy check out the site to see how your data is kept secure thanks for listening we're excited to see how you use perspective you
Original Description
Perspective is a free API that helps you host better conversations online. The API uses machine learning models to score the perceived impact a comment might have on a conversation. You can use this score to implement tools that give feedback to commenters, help moderators more easily review comments, allow readers to more easily find interesting or productive comments, and more. In this tutorial, we’ll show you how to get started!
Timestamps:
0:00 Introduction
00:48 What is Perspective?
02:15 How can I use it?
04:02 Getting Started
04:33 Create a Google Cloud Project
05:30 Request API Access
05:53 Enable the API
06:24 Generate API Key
07:22 Resources
Learn more on the Perspective Developers site at → https://goo.gle/3m10iG8
Additional resources:
Best Practices and Risks → https://goo.gle/2GIBMtn
Methods → https://goo.gle/334IvoM
Request API Access → https://goo.gle/3jTQpbp
I built a moderation bot for Discord → https://goo.gle/35ex28Q
Subscribe to Google Developers → https://goo.gle/developers
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google for Developers · Google for Developers · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Developer Journey - Sunnyvale DSC Summit ‘19
Google for Developers
How Google is working with students - Sunnyvale DSC Summit ‘19
Google for Developers
Starting your career in the Cloud - Sunnyvale DSC Summit ‘19
Google for Developers
The Solution Challenge - Sunnyvale DSC Summit ‘19
Google for Developers
Firebase - Sunnyvale DSC Summit ‘19
Google for Developers
Cloud Hero - Sunnyvale DSC Summit ‘19
Google for Developers
Panel discussion - Sunnyvale DSC Summit ‘19
Google for Developers
The art of negotiation - Sunnyvale DSC Summit ‘19
Google for Developers
Courage to care, solve and share - Sunnyvale DSC Summit ‘19
Google for Developers
Version 9 of Angular, Glass Enterprise Edition 2, path to DX deprecation, & more!
Google for Developers
[DEPRECATING] Introducing a new series (Assistant for Developers Pro Tips)
Google for Developers
Detecting memory bugs with HWASan, Bazel 2.1, Next ‘20 session guide, & more!
Google for Developers
Why Podcast.app chose a .app domain name
Google for Developers
Machine Learning Bootcamp Jakarta 2019
Google for Developers
Android Studio 3.6, Android 11 Developer Preview, Kubeflow 1.0, & more!
Google for Developers
[DEPRECATING] Importance of community (Assistant on Air)
Google for Developers
Why the Flutter team switched from .io to a .dev domain name
Google for Developers
3 website-building tips from .dev creators
Google for Developers
Why NimbleDroid chose a .app domain name
Google for Developers
Android Platform Codelab, Bazel 2.2, Maps Android Utility Library v1.0, & more!
Google for Developers
Google for Games Developer Summit: A free, digital experience for game developers
Google for Developers
Inspecting Home Graph (Assistant for Developers Pro Tips)
Google for Developers
Google for Games Developer Summit Keynote
Google for Developers
Stadia Games & Entertainment presents: Keys to a great game pitch (Google Games Dev Summit)
Google for Developers
Empowering game developers with Stadia R&D (Google Games Dev Summit)
Google for Developers
Supercharging discoverability with Stadia (Google Games Dev Summit)
Google for Developers
Stadia Games & Entertainment presents: Creating for content creators (Google Games Dev Summit)
Google for Developers
Bringing Destiny to Stadia: A postmortem (Google Games Dev Summit)
Google for Developers
Live Captioning in Google Slides
Google for Developers
[DEPRECATING] User engagement for the Google Assistant
Google for Developers
TensorFlow Dev Summit ‘20, Google for Games Dev Summit, Cloud AI Platform Pipelines, & much more!
Google for Developers
Top 5 from the TensorFlow Dev Summit 2020
Google for Developers
Developer Student Clubs 2019 Turkey Leads Summit
Google for Developers
Building simpler payment experiences | Google Pay Plugin for Magento 2
Google for Developers
Become A Developer Student Club Lead
Google for Developers
Firebase Kotlin Extensions, ARM apps on the Android Emulator, Angular v9.1, & more!
Google for Developers
Test suite for Smart Home (Assistant for Developers Pro Tips)
Google for Developers
Google Play updates, Bazel 3.0, Business Console for Google Pay, & more!
Google for Developers
How to use error logs (Assistant for Developers Pro Tips)
Google for Developers
Contact Center AI, Android Studio 4.1 Canary 5, TensorFlow QAT API, & more!
Google for Developers
WebView DevTools, Kotlin meets gRPC, Flutter CodePen support, & more! (Episode 200)
Google for Developers
Offline handling for Smart Home (Assistant for Developers Pro Tips)
Google for Developers
Android 11 Dev Preview 3, Google Fonts for Flutter, Shielded VM, & more!
Google for Developers
Machine Learning Foundations: Ep #1 - What is ML?
Google for Developers
Flutter web support updates, BigQuery materialized views, Cloud Spanner emulator, & more!
Google for Developers
Computer vision by building a neural network with TensorFlow | Machine Learning Foundations
Google for Developers
Machine Learning Foundations: Ep #3 - Convolutions and pooling
Google for Developers
Android 11 Beta plans, Flutter 1.17, Dart 2.8, & much more!
Google for Developers
Machine Learning Foundations: Ep #4 - Coding with Convolutional Neural Networks
Google for Developers
Google Developers ML Summit
Google for Developers
Real-world image classification using convolutional neural networks | Machine Learning Foundations
Google for Developers
Adobe XD support for Flutter, Architecture Framework, temporary closures with Places API, & more!
Google for Developers
Machine Learning Foundations: Ep #6 - Convolutional cats and dogs
Google for Developers
Machine Learning Foundations: Ep #7 - Image augmentation and overfitting
Google for Developers
Announcing Firebase Live, Flutter Day, Java 11 on Google Cloud Functions, & more!
Google for Developers
Machine Learning Foundations: Ep #8 - Tokenization for Natural Language Processing
Google for Developers
Android 11 Beta, Google Play Asset Delivery, Firebase Crashlytics SDK, & much more!
Google for Developers
Natural Language Processing: Using sequencing APIs in TensorFlow | Machine Learning Foundations
Google for Developers
Build a sarcasm classifier using NLP and TensorFlow | Machine Learning Foundations
Google for Developers
AR Realism with the ARCore Depth API
Google for Developers
More on: AI Ethics & Policy
View skill →Related Reads
📰
📰
📰
📰
I Did the Math on Claude Opus 5: Max Effort Cost 94% More Than High Effort
Dev.to · tokenmixai
I Banned AI Tools From My Creative Process for 30 Days. Here’s What Happened to My Brain
Medium · AI
Best AI Tools for Content Creators With Zero Budget
Medium · AI
Stop Building AI Chatbots. Build These 7 AI Products Instead.
Medium · Machine Learning
Chapters (9)
Introduction
0:48
What is Perspective?
2:15
How can I use it?
4:02
Getting Started
4:33
Create a Google Cloud Project
5:30
Request API Access
5:53
Enable the API
6:24
Generate API Key
7:22
Resources
🎓
Tutor Explanation
DeepCamp AI