diff --git a/spacy/language.py b/spacy/language.py index 8f3245531..905cdca36 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1281,7 +1281,7 @@ class Language: util.logger.debug(doc) eg.predicted = doc results = scorer.score(examples) - n_words = sum(len(eg.predicted) for eg in examples) + n_words = sum(len(doc) for doc in docs) results["speed"] = n_words / (end_time - start_time) return results diff --git a/spacy/training/loggers.py b/spacy/training/loggers.py index e071e5827..8be456235 100644 --- a/spacy/training/loggers.py +++ b/spacy/training/loggers.py @@ -36,20 +36,12 @@ def console_logger(): keys=list(info["losses"].keys()), ) ) from None - - try: - scores = [ - "{0:.2f}".format(float(info["other_scores"].get(col, 0.0)) * 100) - for col in score_cols - ] - except KeyError as e: - raise KeyError( - Errors.E983.format( - dict="scores (other)", - key=str(e), - keys=list(info["other_scores"].keys()), - ) - ) from None + scores = [] + for col in score_cols: + score = float(info["other_scores"].get(col, 0.0))) + if col != "speed": + score *= 100 + scores.append("{0:.2f}".format(score) data = ( [info["epoch"], info["step"]] + losses