-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
25 lines (20 loc) · 796 Bytes
/
test.py
File metadata and controls
25 lines (20 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from medical_chatbot_main.chatbot_class import SymptomPredictor
# Create an instance of SymptomsPredictor
symptom_predictor = SymptomPredictor()
# Test Inputs
conversation_history = [
{"sender": "user", "message": "I have a headache and fever"},
{"sender": "bot", "message": "How long have you had these symptoms?"},
{"sender": "user", "message": "For two days"},
]
latest_input = "Now I feel nauseous"
# Print the test inputs
print("Testing SymptomsPredictor with:")
print("Conversation History:", conversation_history)
print("Latest Input:", latest_input)
# Run the prediction
try:
result = symptom_predictor.predict(conversation_history, latest_input)
print("Prediction Output:", result)
except Exception as e:
print("Error Occurred:", e)