-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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
Labels
No labels
