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: Extract text descriptives metrics for all named fields from a list of feedback records
  using the TextDescriptives library.
  Args:
      records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
      fields (List[str]): A list of fields to extract metrics for. If None, extract metrics for all fields.
      overwrite (bool): Whether to overwrite existing metadata properties with the same name. Defaults to False.
  Returns:
      pd.DataFrame: A dataframe containing the text descriptives metrics for each record and field.
docstr_tok: ["Extract","text","descriptives","metrics","for","all","named","fields","from","a","list","of","feedback","records","using","the","TextDescriptives","library",".","Args",":","records","(","List","[","Union","[","FeedbackRecord",",","RemoteFeedbackRecord","]","]",")",":","A","list","of","FeedbackDataset","or","RemoteFeedbackDataset","records",".","fields","(","List","[","str","]",")",":","A","list","of","fields","to","extract","metrics","for",".","If","None",",","extract","metrics","for","all","fields",".","overwrite","(","bool",")",":","Whether","to","overwrite","existing","metadata","properties","with","the","same","name",".","Defaults","to","False",".","Returns",":","pd.DataFrame",":","A","dataframe","containing","the","text","descriptives","metrics","for","each","record","and","field","."]
code: def _extract_metrics_for_all_fields(
      self,
      records: List[Union[FeedbackRecord, RemoteFeedbackRecord]],
      fields: List[str],
      overwrite: bool,
  ) -> pd.DataFrame:
      """
      Extract text descriptives metrics for all named fields from a list of feedback records
      using the TextDescriptives library.
      Args:
          records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
          fields (List[str]): A list of fields to extract metrics for. If None, extract metrics for all fields.
          overwrite (bool): Whether to overwrite existing metadata properties with the same name. Defaults to False.
      Returns:
          pd.DataFrame: A dataframe containing the text descriptives metrics for each record and field.
      """
      # Extract all metrics for each field
      field_metrics = {
          field: self._extract_metrics_for_single_field(
              records=records, field=field, overwrite=overwrite
          )
          for field in fields
      }
      field_metrics = {
          field: metrics
          for field, metrics in field_metrics.items()
          if metrics is not None
      }
      # If there is only one field, return the metrics for that field directly
      if len(field_metrics) == 1:
          return list(field_metrics.values())[0]
      else:
          # If there are multiple fields, combine metrics for each field into a single dataframe
          final_metrics = pd.concat(
              field_metrics, axis=1, keys=field_metrics.keys()
          )
          final_metrics.columns = final_metrics.columns.droplevel(0)
      return final_metrics
  
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 3 for calling the TextDescriptivesExtractor obj's underlying member method code with example usage: obj._extract_metrics_for_all_fields(records, fields, overwrite) and returns: final_metrics, list