diff --git a/AI-based Chatbot for Diverse Topics/chatbot.py b/AI-based Chatbot for Diverse Topics/chatbot.py index 7ca5090253..eac5fe4cd2 100644 --- a/AI-based Chatbot for Diverse Topics/chatbot.py +++ b/AI-based Chatbot for Diverse Topics/chatbot.py @@ -4,6 +4,8 @@ nlp = spacy.load("en_core_web_sm") # Function to get the response from the chatbot + + def get_response(query): # Process the user query doc = nlp(query) @@ -63,6 +65,7 @@ def get_response(query): # If no specific response is generated, provide a default response return "I'm sorry, but I'm not sure how to help with that." + # Main chat loop print("Chatbot: Hello! How can I assist you today? Type 'exit' to end the conversation.") while True: