File size: 381 Bytes
f81688c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from transformers import pipeline
classifier = pipeline(
"text-classification",
model="./model",
tokenizer="./model"
)
print("🤖 IntentSnap-AI (type 'exit' to quit)\n")
while True:
text = input("> ")
if text.lower() in ["exit", "quit"]:
break
result = classifier(text)[0]
print(f"🎯 Intent: {result['label']} ({result['score']:.2f})\n")
|