mirror of https://github.com/explosion/spaCy.git
Fix speed report in table
This commit is contained in:
parent
744df9814a
commit
b693d2d224
|
@ -1281,7 +1281,7 @@ class Language:
|
||||||
util.logger.debug(doc)
|
util.logger.debug(doc)
|
||||||
eg.predicted = doc
|
eg.predicted = doc
|
||||||
results = scorer.score(examples)
|
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)
|
results["speed"] = n_words / (end_time - start_time)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
|
@ -36,20 +36,12 @@ def console_logger():
|
||||||
keys=list(info["losses"].keys()),
|
keys=list(info["losses"].keys()),
|
||||||
)
|
)
|
||||||
) from None
|
) from None
|
||||||
|
scores = []
|
||||||
try:
|
for col in score_cols:
|
||||||
scores = [
|
score = float(info["other_scores"].get(col, 0.0)))
|
||||||
"{0:.2f}".format(float(info["other_scores"].get(col, 0.0)) * 100)
|
if col != "speed":
|
||||||
for col in score_cols
|
score *= 100
|
||||||
]
|
scores.append("{0:.2f}".format(score)
|
||||||
except KeyError as e:
|
|
||||||
raise KeyError(
|
|
||||||
Errors.E983.format(
|
|
||||||
dict="scores (other)",
|
|
||||||
key=str(e),
|
|
||||||
keys=list(info["other_scores"].keys()),
|
|
||||||
)
|
|
||||||
) from None
|
|
||||||
data = (
|
data = (
|
||||||
[info["epoch"], info["step"]]
|
[info["epoch"], info["step"]]
|
||||||
+ losses
|
+ losses
|
||||||
|
|
Loading…
Reference in New Issue