Detecting AiGeneratedText with CopyLeaks API doesn't return AI detection results in the final report

463 Views Asked by At

I have integrated with CoopyLeaks, and liked the feature to check if text was written by AI. However, after following the documentation, the results don't return any information regarding this aspect of the scan. Neither the generated PDF or the json object of details. This is the relevant part of the properties config:

properties: {
        aiGeneratedText: {
          detect: true,
        },
        action: 0, //0 : Scan ASAP, 1 : Check-Credits, 2 : Index Only in CopyLeaks Database.
        //scanMethodAlgorithm
        //0:MaximumCoverage: prioritize higher similarity score.
        //1: MaximumResults: prioritize finding more sources.
        scanMethodAlgorithm: 1,
        cheatDetection: true,
        }
  • Other parts of the report are generated successfully.
  • Worth mentioning that contacting the old v2 version directly only for AI detection works, as documented in their link here. However, I'm trying to do it in the v3 scan api, as mentioned by them as well according to this image:

enter image description here

Thank you for your time, and appreciate the help.

2

There are 2 best solutions below

3
On

As you mentioned, Copyleaks provide two options to consume AI Content Detection services:

  • If you planning to make Plagiarism Checker API beside AI content detection scan, you need to use the Plagiarism Checker API and turn on the properties.aiGeneratedText.detect flag. Once Copyleaks will detect AI content on your submitted text, you will be notified about the incident on the Completed Webhook under the section notifications.alerts. If the submitted text will be found as human text, no alert will be created.
  • If you aiming to use the AI Content Detection API without plagiarism check, than you will have to use the Writer Detector API.
0
On

Sharing an alternative in case anyone else comes across this as well - https://sapling.ai/docs/api/detector/#sample-code should be pretty straightforward to get up and running.

curl -X POST https://api.sapling.ai/api/v1/aidetect \
     -H "Content-Type: application/json" \
     -d '{"key":"<api-key>", "text":"This is sample text."}'

The docs have sample code for curl, javascript and python, including an HTML/ javascript SDK that can be directly integrated into your website as well.

<script src="https://sapling.ai/static/js/sapling-sdk-v1.0.5.min.js"></script>

<script type="text/javascript">
  Sapling.init({
    autocomplete: true,
    mode: 'dev',
    key: 'API_DEV_TEST_KEY_SAPLING',
  });

  const contenteditable = document.getElementById('elem1');
  Sapling.observe(contenteditable);

  const aiDetectButton = document.getElementById('ai-detect-button');
  aiDetectButton.addEventListener('click', () => {
    Sapling.checkOnce(contenteditable, {aiDetect: true});
  });
</script>

Here elem1 is your contenteditable/ text area and ai-detect-button is your button to trigger the check.