Zabihin commited on
Commit
2d457e9
1 Parent(s): e9d0197

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -77,8 +77,28 @@ pipe = pipeline("text-classification", model="Zabihin/Symptom_to_Diagnosis")
77
  Example:
78
  result = pipe("I've been having headaches and migraines, and I can't sleep. My whole body shakes and twitches. Sometimes I feel lightheaded.")
79
  result:
 
80
  [{'label': 'drug reaction', 'score': 0.9489321112632751}]
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
 
84
 
 
77
  Example:
78
  result = pipe("I've been having headaches and migraines, and I can't sleep. My whole body shakes and twitches. Sometimes I feel lightheaded.")
79
  result:
80
+
81
  [{'label': 'drug reaction', 'score': 0.9489321112632751}]
82
 
83
+ or
84
+
85
+
86
+ from transformers import pipeline
87
+
88
+ # Load the model
89
+ classifier = pipeline("text-classification", model="Zabihin/Symptom_to_Diagnosis", tokenizer="Zabihin/Symptom_to_Diagnosis")
90
+
91
+ # Example input text
92
+ input_text = "I've been having headaches and migraines, and I can't sleep. My whole body shakes and twitches. Sometimes I feel lightheaded."
93
+
94
+ # Get the predicted label
95
+ result = classifier(input_text)
96
+
97
+ # Print the predicted label
98
+ predicted_label = result[0]['label']
99
+ print("Predicted Label:", predicted_label)
100
+
101
+ Predicted Label: drug reaction
102
 
103
 
104