adaptive_rag / hallucination_config.py
lanny xu
delete vectara
543b684
raw
history blame contribute delete
602 Bytes
"""
Hallucination Detector Configuration
Configure which detection method to use
"""
# Detection method: 'vectara', 'nli', or 'hybrid' (recommended)
# 使用 'nli' 可以完全避免 Vectara 权限问题
HALLUCINATION_DETECTION_METHOD = "nli"
# Thresholds
VECTARA_HALLUCINATION_THRESHOLD = 0.5 # Score above this = hallucination
NLI_CONTRADICTION_THRESHOLD = 0.3 # Percentage of contradictions to flag
# Performance settings
USE_GPU = True # Use GPU if available
BATCH_SIZE = 8 # For batch processing
# Fallback behavior
FALLBACK_TO_LLM = True # If professional detectors fail, use LLM method