pytorch-chatbot
pytorch-chatbot copied to clipboard
Functions for each intent tag
How do I execute a function for a specific tag? for example if the tag is 'goodbye' I want the chatbot to stop the program using sys.exit(0)
I tried this:
if prob.item() > 0.75:
for intent in intents['intents']:
if tag == intent["tag"]:
speak(f"{random.choice(intent['responses'])}")
if tag == "goodbye":
speak(f"{random.choice(intent['responses'])}")
sys.exit(0)
But the chatbot does not respond with a response from that specific tag