Skip to content

Commit

Permalink
Create chatbot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored May 10, 2024
1 parent 76f80ff commit 896f93f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions customer_service/chatbot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import time

class Chatbot:
def __init__(self, nlp_model, knowledge_base):
self.nlp_model = nlp_model
self.knowledge_base = knowledge_base

def chat(self, user_input):
entities = self.nlp_model.extract_entities(user_input)
intent = self.nlp_model.extract_intent(user_input)
response = self.knowledge_base.get_response(intent)
print('User:', user_input)
print('Chatbot:', response)
time.sleep(1)

0 comments on commit 896f93f

Please sign in to comment.