import gradio as gr def detect_lie(text): if not text.strip(): return "⚠️ Please enter a statement." text_lower = text.lower() words = text.split() result = "✅ Truthful" confidence = 90 explanation = "The statement appears clear and neutral." color = "#22c55e" if len(words) > 25: result = "⚠️ Suspicious" confidence = 65 explanation = "Too many details may indicate over-explanation." color = "#f59e0b" elif "honestly" in text_lower or "trust me" in text_lower: result = "⚠️ Suspicious" confidence = 70 explanation = "Over-justification phrases detected." color = "#f59e0b" elif any(word in text_lower for word in ["never", "no", "not", "nothing"]): result = "❌ Likely Lie" confidence = 80 explanation = "Negative wording may indicate denial or deception." color = "#ef4444" return f"""
Confidence: {confidence}%
Explanation: {explanation}