import os
import joblib
from fusion.fused_classifier import FusedClassifier
from rules.assertive_rules import assertive_rule, ASSERTIVE_INTENT_VERBS
from rules.negation import is_negated_intent

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


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

    fused = FusedClassifier(
        model=model,
        rule_fn=assertive_rule,
        alpha=0.5,
        threshold=0.5,
        negation_fn=is_negated_intent,
        intent_verbs=ASSERTIVE_INTENT_VERBS
    )

    tests = [
        "You must complete this task today.",
        "Make sure the report is submitted.",
        "If you don't mind, could you review this?",
        "I think maybe we should wait.",
        "The document describes the process."
    ]

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


if __name__ == "__main__":
    main()
