Description Usage Arguments Details Value Examples
Provide a character string with your text, your API key and what scores you want to obtain.
1 2 3 4 5 6 7 8 9 10 |
text |
a character string. |
text_id |
a unique ID for the text that you supply (required). |
languages |
A vector of ISO 631-1 two-letter language codes specifying the language(s) that comment is in (for example, "en", "es", "fr", "de", etc). If unspecified, the API will autodetect the comment language. If language detection fails, the API returns an error. |
score_sentences |
A boolean value that indicates if the request should return spans that describe the scores for each part of the text (currently done at per sentence level). Defaults to |
score_model |
Specify what model do you want to use (for example |
sleep |
how long should |
doNotStore |
Whether the API is permitted to store comment from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. Perspective API also plans to provide dashboards and automated analysis of the comments submitted, which will apply only to those stored. Defaults to |
key |
Your API key (see here to set up an API key). |
For more details see ?peRspective
or Perspective API documentation
a tibble
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
## GET TOXICITY SCORES for a comment
prsp_score("Hello, I am a test comment!",
score_model = "TOXICITY")
## GET TOXICITY and SEVERE_TOXICITY Scores for a comment
prsp_score("Hello, I am a test comment!",
score_model = c("TOXICITY", "SEVERE_TOXICITY"))
## GET TOXICITY and SEVERE_TOXICITY Scores for each sentence of a comment
prsp_score("Hello, I am a test comment!
I am a second sentence and I will (hopefully) be scored seperately",
score_model = c("TOXICITY", "SEVERE_TOXICITY"),
score_sentences = T)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.