code: def evaluate_model(
      model,
      *,
      X_test: Sequence[str],
      Y_test: thinc.types.Array2d,
      batch_size: int,
  ) -> float:
      """
      Args:
          model
          X_test
          Y_test
          batch_size
      """
      correct = 0
      total = 0
      for X, Y in model.ops.multibatch(batch_size, X_test, Y_test):
          Yh = model.predict(X)
          for yh, y in zip(Yh, Y):
              correct += (y.argmax(axis=0) == yh.argmax(axis=0)).sum()
          total += len(Y)
      return float(correct / total)
  
file_path: textacy/src/textacy/lang_id/_training.py
imports: from __future__ import annotations
  from typing import Iterable, List, Sequence, Tuple
  import sklearn.preprocessing
  import thinc
  from tqdm import tqdm
  from thinc.api import Model
  from .None import models
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate_model(model) and returns: float