import os
import joblib
from fusion.fused_classifier import FusedClassifier
from rules.negation import is_negated_intent
from rules.persuasive_rules import persuasive_rule, PERSUASIVE_INTENT_VERBS

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MODEL_PATH = os.path.join(BASE_DIR, "artifacts", "persuasive_model.joblib")


def main():
    model = joblib.load(MODEL_PATH)

    # Persuasion relies on intent, so balanced fusion
    fused = FusedClassifier(
        model=model,
        rule_fn=persuasive_rule,
        alpha=0.6,
        threshold=0.5,
        negation_fn=is_negated_intent,
        intent_verbs=PERSUASIVE_INTENT_VERBS
    )

    tests = [
        "You should consider using this approach.",
        "I strongly recommend adopting this solution.",
        "This document explains the system architecture.",
        "The paper describes the experimental setup.",
        "We should move forward with this plan."
    ]

    for t in tests:
        pred = fused.predict(t)
        label = "Persuasive" if pred == 1 else "Informative"
        print(f"{label} → {t}")


if __name__ == "__main__":
    main()
