Skip to content

Issue in Humanize & verify /humanize_and_check API #1

@usmanf07

Description

@usmanf07

Image

Bug: detect_ai_text Not Defined
Error Message:
ERROR:__main__:Error in humanize and check: name 'detect_ai_text' is not defined
💡 Description:
The error occurs because the detect_ai_text function is being called in main.py without being properly imported from the detector module.

✅ Fix:
To resolve this issue, ensure you import the detector module in your main.py file. Then, update your function calls as shown below:

# Import the detector module
import detector

# For the humanized text
humanized_detection = detector.detect_ai_text(humanized_text, method="ensemble")
humanized_is_ai, humanized_confidence = detector.is_ai_generated(humanized_text, detection_threshold)

# For the original text
original_detection = detector.detect_ai_text(text, method="ensemble")
original_is_ai, original_confidence = detector.is_ai_generated(text, detection_threshold)

🛠️ Result:
This fix will properly reference the functions within the detector module and prevent the NameError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions