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 from records in a FeedbackDataset
  or RemoteFeedbackDataset, add them as metadata to the records and
  return the updated dataset.
  
  Args:
      dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): A FeedbackDataset or RemoteFeedbackDataset.
      fields (Optional[List[str]]): A list of fields to extract metrics for. If None, extract metrics for all fields.
      update_records (Optional[bool]): Whether to update the records in the dataset too. Defaults to True.
      overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.
  
  Returns:
      Union[FeedbackDataset, RemoteFeedbackDataset]: A FeedbackDataset or RemoteFeedbackDataset with text descriptives metrics added as metadata.
  
  Examples:
  >>> import argilla as rg
  >>> from argilla.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
  >>> dataset = rg.FeedbackDataset(...)
  >>> tde = TextDescriptivesExtractor()
  >>> updated_dataset = tde.update_dataset(dataset)
docstr_tok: ["Extract","text","descriptives","metrics","from","records","in","a","FeedbackDataset","or","RemoteFeedbackDataset",",","add","them","as","metadata","to","the","records","and","return","the","updated","dataset",".","Args",":","dataset","(","Union","[","FeedbackDataset",",","RemoteFeedbackDataset","]",")",":","A","FeedbackDataset","or","RemoteFeedbackDataset",".","fields","(","Optional","[","List","[","str","]","]",")",":","A","list","of","fields","to","extract","metrics","for",".","If","None",",","extract","metrics","for","all","fields",".","update_records","(","Optional","[","bool","]",")",":","Whether","to","update","the","records","in","the","dataset","too",".","Defaults","to","True",".","overwrite","(","Optional","[","bool","]",")",":","Whether","to","overwrite","existing","metadata","properties","with","the","same","name",".","Defaults","to","False",".","Returns",":","Union","[","FeedbackDataset",",","RemoteFeedbackDataset","]",":","A","FeedbackDataset","or","RemoteFeedbackDataset","with","text","descriptives","metrics","added","as","metadata",".","Examples",":",">",">",">","import","argilla","as","rg",">",">",">","from","argilla.client.feedback.integrations.textdescriptives","import","TextDescriptivesExtractor",">",">",">","dataset","=","rg.FeedbackDataset","(","...",")",">",">",">","tde","=","TextDescriptivesExtractor","(",")",">",">",">","updated_dataset","=","tde.update_dataset","(","dataset",")"]
code: def update_dataset(
      self,
      dataset: Union[FeedbackDataset, RemoteFeedbackDataset],
      fields: Optional[List[str]] = None,
      update_records: Optional[bool] = True,
      overwrite: Optional[bool] = False,
  ) -> Union[FeedbackDataset, RemoteFeedbackDataset]:
      """
      Extract text descriptives metrics from records in a FeedbackDataset
      or RemoteFeedbackDataset, add them as metadata to the records and
      return the updated dataset.
  
      Args:
          dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): A FeedbackDataset or RemoteFeedbackDataset.
          fields (Optional[List[str]]): A list of fields to extract metrics for. If None, extract metrics for all fields.
          update_records (Optional[bool]): Whether to update the records in the dataset too. Defaults to True.
          overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.
  
      Returns:
          Union[FeedbackDataset, RemoteFeedbackDataset]: A FeedbackDataset or RemoteFeedbackDataset with text descriptives metrics added as metadata.
  
      Examples:
      >>> import argilla as rg
      >>> from argilla.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
      >>> dataset = rg.FeedbackDataset(...)
      >>> tde = TextDescriptivesExtractor()
      >>> updated_dataset = tde.update_dataset(dataset)
      """
      # If fields is None, use all fields
      if fields is None:
          fields = [field.name for field in dataset.fields]
      available_fields = [field.name for field in dataset.fields]
      if not all([field in available_fields for field in fields]):
          raise ValueError(
              f"Fields {fields} are not present in the dataset."
          )
      # Create metadata properties based on dataframe columns and data types
      dataset = self._create_metadata_property_settings(
          dataset=dataset, fields=fields, overwrite=overwrite
      )
  
      # Update the records in the dataset too
      if update_records:
          records = self.update_records(
              records=dataset.records,
              fields=fields,
              overwrite=overwrite,
          )
          if isinstance(dataset, RemoteFeedbackDataset):
              dataset.update_records(records)
      return dataset
  
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 10 for calling the TextDescriptivesExtractor obj's underlying member method code with example usage: obj.update_dataset(dataset, fields, update_records, overwrite) and returns: dataset