monthly-basis/content-moderation

v0.17.2 2024-08-10 16:50 UTC

This package is auto-updated.

Last update: 2024-09-12 00:04:56 UTC


README

确定文本是否包含不良词汇。

警告

此存储库的源代码包含极其露骨的语言。

我们已编写代码以确定字符串是否包含不良词汇。

不幸的是,为了确保此代码能够正常工作,我们必须在我们的代码中使用露骨的语言。

抱歉。

安装

composer require monthly-basis/content-moderation

示例

独立PHP

<?php
require_once('vendor/autoload.php');

$containsBadWords = MonthlyBasis\ContentModeration\Model\Factory\ContainsBadWords::build();

$string = 'hello world';

if ($containsBadWords->containsBadWords($string)) {
    echo 'Your string contains bad words!';
} else {
    echo 'Phew, your string does not contain bad words.';
}

GET请求

https://content-moderation.monthly-basis.com/api/v0/contains-bad-words?string=hello+world

JSON响应

{
    "contains-bad-words": false,
    "success": true
}