Spaces:
Sleeping
Sleeping
Update modules/classifier.py
Browse files- modules/classifier.py +2 -2
modules/classifier.py
CHANGED
|
@@ -24,11 +24,11 @@ def classify_text(text):
|
|
| 24 |
score = res['score']
|
| 25 |
label_scores[label] = label_scores.get(label, 0) + score
|
| 26 |
except Exception as e:
|
| 27 |
-
print(f"
|
| 28 |
continue
|
| 29 |
|
| 30 |
if not label_scores:
|
| 31 |
-
return "
|
| 32 |
|
| 33 |
final_label = max(label_scores, key=label_scores.get)
|
| 34 |
confidence = round(label_scores[final_label] / len(chunks), 3)
|
|
|
|
| 24 |
score = res['score']
|
| 25 |
label_scores[label] = label_scores.get(label, 0) + score
|
| 26 |
except Exception as e:
|
| 27 |
+
print(f"Error classifying chunk {i+1}: {e}")
|
| 28 |
continue
|
| 29 |
|
| 30 |
if not label_scores:
|
| 31 |
+
return "Could not classify any chunk."
|
| 32 |
|
| 33 |
final_label = max(label_scores, key=label_scores.get)
|
| 34 |
confidence = round(label_scores[final_label] / len(chunks), 3)
|