copyleaks/php-plagiarism-checker
Composer 安装命令:
composer require copyleaks/php-plagiarism-checker
包简介
Copyleaks detects online plagiarism and checks content distribution. Use Copyleaks to find out if textual content is original and where it has been used before. This package shows how to integrate with the Copyleaks cloud to search for copyright infringement.
README 文档
README
The official Copyleaks PHP library, supporting PHP versions >=7.4.0.
🚀 Getting Started
Before you start, ensure you have the following:
- An active Copyleaks account. If you don’t have one, sign up for free.
- You can find your API key on the API Dashboard.
Once you have your account and API key:
Install the SDK:
Install using Packagist
composer require copyleaks/php-plagiarism-checker
📚 Documentation
To learn more about how to use Copyleaks API please check out our Documentation.
💡 Usage Examples
Here are some common usage examples for the Copyleaks SDK. You can also see a comprehensive code example in the demo.php file on our GitHub repository: demo.php.
Get Authentication Token
This example demonstrates how to log in to the Copyleaks API and obtain an authentication token.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksFileSubmissionModel; use Copyleaks\SubmissionProperties; use Copyleaks\SubmissionWebhooks; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; $WEBHOOK_URL = 'https://your-server.com/webhook/{STATUS}'; // -------------------- // Log in to the Copyleaks API echo "Authenticating...\n"; $copyleaks = new Copyleaks(); $loginToken = $copyleaks->login($EMAIL_ADDRESS, $KEY); echo "✅ Logged in successfully!\n";
For a detailed understanding of the authentication process, refer to the Copyleaks Login Endpoint Documentation.
Submit Text for Plagiarism Scan
This example shows how to prepare and submit raw text content for a plagiarism scan.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksFileSubmissionModel; use Copyleaks\SubmissionProperties; use Copyleaks\SubmissionWebhooks; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; $WEBHOOK_URL = 'https://your-server.com/webhook/{STATUS}'; // -------------------- // Prepare your content for scanning echo "Submitting text for scanning...\n"; $textToScan = "Hello world, this is a test."; $base64Content = base64_encode($textToScan); $scanId = time(); // Configure the scan $webhooks = new SubmissionWebhooks($WEBHOOK_URL); $properties = new SubmissionProperties($webhooks); $properties->setSandbox(true); // Turn on sandbox mode for testing $submission = new CopyleaksFileSubmissionModel($base64Content, 'test.txt', $properties); // Submit the scan to Copyleaks $copyleaks->submitFile($loginToken, $scanId, $submission); echo "🚀 Scan submitted successfully! Scan ID: " . $scanId . "\n"; echo "You will be notified via your webhook when the scan is complete.\n";
For a full guide please refer to our step by step Guide
For a detailed understanding of the plagiarism detection process, refer to the Copyleaks Submit Endpoint Documentation
AI-Generated Text Detection
Use the AI detection client to determine if content was generated by artificial intelligence.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksNaturalLanguageSubmissionModel; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; // -------------------- $sampleText = "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures."; $submission = new CopyleaksNaturalLanguageSubmissionModel( $sampleText, ); $submission->sandbox = true; $response = $this->copyleaks->aiDetectionClient->submitNaturalLanguage($authToken, time(), $submission); $this->logInfo('AI Detection - submitNaturalLanguage', $response);
Writing Assistant
Get intelligent suggestions for improving grammar, spelling, style, and overall writing quality.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksWritingAssistantSubmissionModel; use Copyleaks\ScoreWeights; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; // -------------------- $sampleText = "Lions are the only cat that live in groups, called pride. A prides typically consists of a few adult males, several feales, and their offspring. This social structure is essential for hunting and raising young cubs. Female lions, or lionesses are the primary hunters of the prid. They work together in cordinated groups to take down prey usually targeting large herbiores like zbras, wildebeest and buffalo. Their teamwork and strategy during hunts highlight the intelligence and coperation that are key to their survival."; $scoreWeights = new ScoreWeights( 0.1, 0.2, 0.3, 0.4 ); $submission = new CopyleaksWritingAssistantSubmissionModel( $sampleText, ); $submission->sandbox = true; $submission->score = $scoreWeights; $response = $this->copyleaks->writingAssistantClient->submitText($authToken, time(), $submission); $this->logInfo('Writing Assistant - submitText', $response);
For a full guide please refer to our step by step Guide
For a detailed understanding of the Writing assistant process, refer to the Copyleaks writing feedback Endpoint Documentation
Text Moderation
Scan and moderate text content for unsafe, inappropriate, or policy-violating material across various categories.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksTextModerationRequestModel; use Copyleaks\CopyleaksTextModerationConstants; use Copyleaks\CopyleaksTextModerationLanguages; use Copyleaks\CopyleaksTextModerationResponseModel; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; // -------------------- $labelsArray=[ new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::ADULT_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::TOXIC_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::VIOLENT_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::PROFANITY_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::SELF_HARM_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::HARASSMENT_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::HATE_SPEECH_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::DRUGS_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::FIREARMS_V1), new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants::CYBERSECURITY_V1) ]; // labels $textModerationRequest = new CopyleaksTextModerationRequestModel( "This is some text to scan.", // text true, // sandbox mode CopyleaksTextModerationLanguages::ENGLISH, // language $labelsArray ); $response = $this->copyleaks->textModerationClient->submitText($authToken, time(), $model); $textModerationResponse= CopyleaksTextModerationResponseModel::fromArray(json_decode(json_encode($response), true)); $this->logInfo('Text Moderation - submitText', $textModerationResponse);
For a full guide please refer to our step by step Guide
For a detailed understanding of the Text moderation process, refer to the Copyleaks text moderation Endpoint Documentation
AI Image Detection
Determine if a given image was generated or partially generated by an AI.
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Copyleaks\Copyleaks; use Copyleaks\CopyleaksAuthToken; use Copyleaks\CopyleaksAiImageDetectionRequestModel; use Copyleaks\CopyleaksAiImageDetectionResponseModel; use Copyleaks\CopyleaksAiImageDetectionModels; // --- Your Credentials --- $EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; $KEY = 'YOUR_API_KEY'; // -- // Read and encode your image file to base64 $imagePath = "path/to/your/image.jpg"; // Update this path to your actual image file $base64Image = base64_encode(file_get_contents($imagePath)); $fileName = basename($imagePath); $submission = new CopyleaksAiImageDetectionRequestModel( $base64Image, $fileName, CopyleaksAiImageDetectionModels::AI_IMAGE_1_ULTRA, true // Use sandbox mode for testing ); $response = $copyleaks->aiImageDetectionClient->submit($authToken, time(), $submission); $imageDetectionResponse = CopyleaksAiImageDetectionResponseModel::fromArray(json_decode(json_encode($response), true));
For a full guide please refer to our step by step Guide
For a detailed understanding of the AI image detection process, refer to the Copyleaks AI image detection Endpoint Documentation
Further Resources
- Copyleaks API Dashboard: Manage your API keys, monitor usage, and view analytics from your personalized dashboard. Access Dashboard
- Copyleaks SDK Documentation: Explore comprehensive guides, API references, and code examples for seamless integration. Read Documentation
Support
- If you need assistance, please contact Copyleaks Support via our support portal: Contact Copyleaks Support.
- To arrange a product demonstration, book a demo here: Booking Link.
copyleaks/php-plagiarism-checker 适用场景与选型建议
copyleaks/php-plagiarism-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 71.49k 次下载、GitHub Stars 达 50, 最近一次更新时间为 2016 年 05 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「publisher」 「education」 「checker」 「plagiarism」 「copyrights」 「Copyleaks」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 copyleaks/php-plagiarism-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 copyleaks/php-plagiarism-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 copyleaks/php-plagiarism-checker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).
This package provides null implementation for interactiv4/checker-contracts package.
Build persistence-agnostic storage layer.
Bridge between JMS Serializer Bundle and Superdesk Web Publisher.
Anax Request module, details on the request.
Scope and owner aware settings system. Define settings in configuration, keep customized values in storage.
统计信息
- 总下载量: 71.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 51
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-30