From 2e5ab5b59c29f2d879b4f2a7f820c872f798d0ab Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 18 Sep 2019 19:57:08 +0200 Subject: [PATCH] Make except more explicit --- spacy/scorer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/scorer.py b/spacy/scorer.py index 19f157451..9c057d0a3 100644 --- a/spacy/scorer.py +++ b/spacy/scorer.py @@ -60,7 +60,7 @@ class ROCAUCScore(object): self.saved_score = _roc_auc_score(self.golds, self.cands) # catch ValueError: Only one class present in y_true. # ROC AUC score is not defined in that case. - except: + except ValueError: self.saved_score = -float("inf") self.saved_score_at_len = len(self.golds) return self.saved_score