mirror of https://github.com/explosion/spaCy.git
Replace numpy floats in evaluate and update
This commit is contained in:
parent
0576a1ff56
commit
3d03565498
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue