perspective-package: peRspective: Interface to the Perspective API

Description Get API Key Suggested Usage of API Key Quota and character length Limits Models in Productions Experimental models New York Times moderation models Don't forget to regain your spirits

Description

Provides access to the Perspective API (http://www.perspectiveapi.com/). Perspective is an API that uses machine learning models to score the perceived impact a comment might have on a conversation. peRspective provides access to the API using the R programming language. For an excellent documentation of the Perspective API see here.

Get API Key

Follow these steps as outlined by the Perspective API to get an API key.

Suggested Usage of API Key

peRspective functions will read the API key from environment variable perspective_api_key. You can specify it like this at the start of your script:

Sys.setenv(perspective_api_key = "**********")

To start R session with the initialized environment variable create an .Renviron file in your R home with a line like this:

perspective_api_key = "**********"

To check where your R home is, try normalizePath("~").

Quota and character length Limits

You can check your quota limits by going to your google cloud project's Perspective API page, and check your projects quota usage at the cloud console quota usage page.

The maximum text size per request is 3000 bytes.

Models in Productions

The following production-ready models are recommended for use. They have been tested across multiple domains and trained on hundreds of thousands of comments tagged by thousands of human moderators. These are available in English (en), Spanish, (es), French (fr), German (de), Portuguese (pt), Italian (it), Russian (ru).

Experimental models

The following experimental models give more fine-grained classifications than overall toxicity. They were trained on a relatively smaller amount of data compared to the primary toxicity models above and have not been tested as thoroughly.

For more details on how these were trained, see the Toxicity and sub-attribute annotation guidelines.

New York Times moderation models

The following experimental models were trained on New York Times data tagged by their moderation team.

Don't forget to regain your spirits

Analyzing toxic comments can be disheartening sometimes. Feel free to look at this picture of cute kittens whenever you need to:

Kittens


peRspective documentation built on July 14, 2021, 9:06 a.m.