mirror of
https://github.com/wassname/talk.git
synced 2026-08-18 12:30:39 +08:00
Merge master
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: talk-plugin-toxic-comments
|
||||
permalink: /plugin/talk-plugin-toxic-comments/
|
||||
layout: plugin
|
||||
plugin:
|
||||
name: talk-plugin-toxic-comments
|
||||
provides:
|
||||
- Server
|
||||
- Client
|
||||
---
|
||||
|
||||
Using the [Perspective API](http://perspectiveapi.com/), this
|
||||
plugin will warn users and reject comments that exceed the predefined toxicity
|
||||
threshold. For more information on what Toxic Comments are, check out the
|
||||
[Toxic Comments](/talk/toxic-comments/) documentation.
|
||||
|
||||
Configuration:
|
||||
|
||||
- `TALK_PERSPECTIVE_API_KEY` (**required**) - The API Key for Perspective. You
|
||||
can register and get your own key at [http://perspectiveapi.com/](http://perspectiveapi.com/).
|
||||
- `TALK_TOXICITY_THRESHOLD` - If the comments toxicity exceeds this threshold,
|
||||
the comment will be rejected. (Default `0.8`)
|
||||
- `TALK_PERSPECTIVE_API_ENDPOINT` - API Endpoint for hitting the
|
||||
perspective API. (Default `https://commentanalyzer.googleapis.com/v1alpha1`)
|
||||
- `TALK_PERSPECTIVE_TIMEOUT` - The timeout for sending a comment to
|
||||
be processed before it will skip the toxicity analysis, parsed by
|
||||
[ms](https://www.npmjs.com/package/ms). (Default `300ms`)
|
||||
- `TALK_PERSPECTIVE_DO_NOT_STORE` - Whether the API is permitted to store comment and context from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. (Default `true`) [Perspective API - Analize Comment Request](https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md#analyzecomment-request)
|
||||
@@ -15,8 +15,11 @@ export default class CheckToxicityHook extends React.Component {
|
||||
// If we haven't check the toxicity yet, make sure to include `checkToxicity=true` in the mutation.
|
||||
// Otherwise post comment without checking the toxicity.
|
||||
if (!this.checked) {
|
||||
input.checkToxicity = true;
|
||||
this.checked = true;
|
||||
return {
|
||||
...input,
|
||||
checkToxicity: true,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
ar:
|
||||
error:
|
||||
COMMENT_IS_TOXIC: |
|
||||
هل أنت واثق؟ قد تنتهك اللغة الواردة في هذا التعليق إرشادات المجموعة. يمكنك تعديل التعليق أو إرساله لمراجعته.
|
||||
talk-plugin-toxic-comments:
|
||||
unlikely: "من غير المرجح"
|
||||
highly_likely: "من المرجح جدا"
|
||||
possibly: "ربما"
|
||||
likely: "مرجح"
|
||||
toxic_comment: "تعليق سام"
|
||||
still_toxic: |
|
||||
قد يظل هذا التعليق المعدل منتهكاً لإرشادات المجموعة. سيراجع فريق الإشراف لدينا تعليقك قريبا.
|
||||
flags:
|
||||
reasons:
|
||||
comment:
|
||||
toxic_comment: "من المرجح جدا أن يكون ساماً"
|
||||
da:
|
||||
error:
|
||||
COMMENT_IS_TOXIC: |
|
||||
|
||||
Reference in New Issue
Block a user