class_docstr: This class extracts a number of basic text descriptives from FeedbackDataset
  records using the TextDescriptives library and adds them as record metadata.
class_docstr_tok: ["This","class","extracts","a","number","of","basic","text","descriptives","from","FeedbackDataset","records","using","the","TextDescriptives","library","and","adds","them","as","record","metadata","."]
docstr: Add the text descriptives metrics extracted previously as metadata
  to a list of FeedbackDataset records.
  
  Args:
      records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
      df (pd.DataFrame): The text descriptives dataframe.
  
  Returns:
      List[Union[FeedbackRecord, RemoteFeedbackRecord]]: A list of FeedbackDataset or RemoteFeedbackDataset records with extracted metrics added as metadata.
docstr_tok: ["Add","the","text","descriptives","metrics","extracted","previously","as","metadata","to","a","list","of","FeedbackDataset","records",".","Args",":","records","(","List","[","Union","[","FeedbackRecord",",","RemoteFeedbackRecord","]","]",")",":","A","list","of","FeedbackDataset","or","RemoteFeedbackDataset","records",".","df","(","pd.DataFrame",")",":","The","text","descriptives","dataframe",".","Returns",":","List","[","Union","[","FeedbackRecord",",","RemoteFeedbackRecord","]","]",":","A","list","of","FeedbackDataset","or","RemoteFeedbackDataset","records","with","extracted","metrics","added","as","metadata","."]
code: def _add_text_descriptives_to_metadata(
      self,
      records: List[Union[FeedbackRecord, RemoteFeedbackRecord]],
      df: pd.DataFrame,
  ) -> List[Union[FeedbackRecord, RemoteFeedbackRecord]]:
      """
      Add the text descriptives metrics extracted previously as metadata
      to a list of FeedbackDataset records.
  
      Args:
          records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
          df (pd.DataFrame): The text descriptives dataframe.
  
      Returns:
          List[Union[FeedbackRecord, RemoteFeedbackRecord]]: A list of FeedbackDataset or RemoteFeedbackDataset records with extracted metrics added as metadata.
      """
      modified_records = []
      with Progress() as progress_bar:
          task = progress_bar.add_task(
              "Adding text descriptives to metadata...",
              total=len(records),
              visible=self.show_progress,
          )
          for record, metrics in zip(records, df.to_dict("records")):
              filtered_metrics = {
                  key: value
                  for key, value in metrics.items()
                  if not pd.isna(value)
              }
              filtered_metrics = {
                  key: int(value)
                  if isinstance(value, float) and value.is_integer()
                  else value
                  for key, value in filtered_metrics.items()
              }
              record.metadata.update(filtered_metrics)
              modified_records.append(record)
              progress_bar.update(task, advance=1)
      return modified_records
  
imports: import logging
  import re
  import warnings
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from rich.progress import Progress
  from argilla.client.feedback.dataset.local.dataset import FeedbackDataset
  from argilla.client.feedback.dataset.remote.dataset import RemoteFeedbackDataset
  from argilla.client.feedback.schemas.metadata import FloatMetadataProperty, IntegerMetadataProperty, TermsMetadataProperty
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.schemas.remote.records import RemoteFeedbackRecord
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 8 for calling the TextDescriptivesExtractor obj's underlying member method code with example usage: obj._add_text_descriptives_to_metadata(records, df) and returns: modified_records