predict
Browse files
predict
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
!pip install torch
|
| 2 |
+
!pip install transformers
|
| 3 |
+
import torch
|
| 4 |
+
from transformers import pipeline
|
| 5 |
+
model_name = "model_name" # Replace with the name or path of the pre-trained model
|
| 6 |
+
classifier = pipeline("text-classification", model=model_name)
|
| 7 |
+
|
| 8 |
+
text = "Skin lesion description" # Replace with the skin lesion description you want to predict
|
| 9 |
+
prediction = classifier(text)[0]
|
| 10 |
+
predicted_label = prediction["label"]
|
| 11 |
+
predicted_score = prediction["score"]
|