Spaces:
Sleeping
Sleeping
Commit ·
bca3cba
1
Parent(s): e50261c
updated commit 005
Browse files
model/alarm_classifier.py
CHANGED
|
@@ -5,6 +5,6 @@ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnl
|
|
| 5 |
|
| 6 |
|
| 7 |
def classify_alarm(alarm_text):
|
| 8 |
-
labels = ["
|
| 9 |
result = classifier(alarm_text, candidate_labels=labels)
|
| 10 |
-
return result[0][
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
def classify_alarm(alarm_text):
|
| 8 |
+
labels = ["power failure", "link down", "overheating", "hardware issue", "configuration error"]
|
| 9 |
result = classifier(alarm_text, candidate_labels=labels)
|
| 10 |
+
return result["labels"][0], result["scores"][0]
|