@@ -197,9 +197,9 @@ def train_while_improving(
197
197
if not (step % eval_frequency ):
198
198
if optimizer .averages :
199
199
with nlp .use_params (optimizer .averages ):
200
- score , other_scores = evaluate (step )
200
+ score , other_scores = evaluate ()
201
201
else :
202
- score , other_scores = evaluate (step )
202
+ score , other_scores = evaluate ()
203
203
results .append ((score , step ))
204
204
is_best_checkpoint = score == max (results )[0 ]
205
205
else :
@@ -248,10 +248,8 @@ def create_evaluation_callback(
248
248
) -> Callable [[], Tuple [float , Dict [str , float ]]]:
249
249
weights = {key : value for key , value in weights .items () if value is not None }
250
250
251
- def evaluate (step ) -> Tuple [float , Dict [str , float ]]:
252
- # Limit dev_examples by steps, so we don't spend longer on
253
- # the estimation than we have training.
254
- dev_examples = list (itertools .islice (dev_corpus (nlp ), step ))
251
+ def evaluate () -> Tuple [float , Dict [str , float ]]:
252
+ dev_examples = list (dev_corpus (nlp ))
255
253
try :
256
254
scores = nlp .evaluate (dev_examples )
257
255
except KeyError as e :
0 commit comments