class_docstr: Configures monitoring over Hugging Face text classification pipelines
class_docstr_tok: ["Configures","monitoring","over","Hugging","Face","text","classification","pipelines"]
code: def __call__(self, inputs, *args, **kwargs):
      metadata = kwargs.pop("metadata", None)
      batch_predictions = self.__model__(inputs, *args, **kwargs)
      try:
          if not isinstance(inputs, list):
              inputs = [inputs]
          if not metadata:
              metadata = [None] * len(inputs)
          elif not isinstance(metadata, list):
              metadata = [metadata]
  
          predictions_ = []
          for pred in batch_predictions:
              if isinstance(pred, dict):
                  pred = [pred]
              predictions_.append(
                  [LabelPrediction.parse_obj(p) for p in pred]
              )
  
          filtered_data = [
              (input_, meta, predictions)
              for input_, meta, predictions in zip(
                  inputs, metadata, predictions_
              )
              if self.is_record_accepted()
          ]
          if filtered_data:
              self.send_records(filtered_data)
  
      finally:
          return batch_predictions
  
imports: from datetime import datetime
  from typing import Any, Dict, List, Optional, Tuple, Union
  from argilla.client.api import Api
  from argilla.client.models import TextClassificationRecord
  from argilla.monitoring.base import BaseMonitor
  from argilla.monitoring.types import MissingType
  from argilla.pydantic_v1 import BaseModel
label_desc: Use image node_id 1 for calling the TextClassificationMonitor obj's underlying member method code with example usage: obj.__call__(inputs) and returns: batch_predictions