diff --git a/spacy/language.py b/spacy/language.py index f2303c10c..3a86f1b9b 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1214,7 +1214,7 @@ class Language: examples, ): eg.predicted = doc - return losses + return _replace_numpy_floats(losses) def rehearse( self, @@ -1465,7 +1465,7 @@ class Language: results = scorer.score(examples, per_component=per_component) n_words = sum(len(eg.predicted) for eg in examples) results["speed"] = n_words / (end_time - start_time) - return results + return _replace_numpy_floats(results) def create_optimizer(self): """Create an optimizer, usually using the [training.optimizer] config."""