class_docstr: The ``TextClassificationData`` class is a :class:`~flash.core.data.data_module.DataModule` with a set of
  classmethods for loading data for text classification.
class_docstr_tok: ["The","``","TextClassificationData","``","class","is","a",":","class",":","`","~flash.core.data.data_module.DataModule","`","with","a","set","of","classmethods","for","loading","data","for","text","classification","."]
docstr: Creates a :class:`~flash.core.data.data_module.DataModule` object from the given export file and data
  directory using the :class:`~flash.core.data.io.input.Input` of name
  :attr:`~flash.core.data.io.input.InputFormat.FOLDERS` from the passed or constructed
  :class:`~flash.core.data.io.input_transform.InputTransform`.
  
  Args:
      export_json: path to label studio export file
      train_export_json: path to label studio export file for train set, overrides export_json if specified
      val_export_json: path to label studio export file for validation
      test_export_json: path to label studio export file for test
      predict_export_json: path to label studio export file for predict
      data_folder: path to label studio data folder
      train_data_folder: path to label studio data folder for train data set, overrides data_folder if specified
      val_data_folder: path to label studio data folder for validation data
      test_data_folder: path to label studio data folder for test data
      predict_data_folder: path to label studio data folder for predict data
      input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the data.
      transform: The :class:`~flash.core.data.io.input_transform.InputTransform` type to use.
      transform_kwargs: Dict of keyword arguments to be provided when instantiating the transforms.
      val_split: The ``val_split`` argument to pass to the :class:`~flash.core.data.data_module.DataModule`.
      multi_label: Whether the labels are multi encoded.
      data_module_kwargs: Additional keyword arguments to use when constructing the datamodule.
  
  Returns:
      The constructed data module.
docstr_tok: ["Creates","a",":","class",":","`","~flash.core.data.data_module.DataModule","`","object","from","the","given","export","file","and","data","directory","using","the",":","class",":","`","~flash.core.data.io.input.Input","`","of","name",":","attr",":","`","~flash.core.data.io.input.InputFormat.FOLDERS","`","from","the","passed","or","constructed",":","class",":","`","~flash.core.data.io.input_transform.InputTransform","`",".","Args",":","export_json",":","path","to","label","studio","export","file","train_export_json",":","path","to","label","studio","export","file","for","train","set",",","overrides","export_json","if","specified","val_export_json",":","path","to","label","studio","export","file","for","validation","test_export_json",":","path","to","label","studio","export","file","for","test","predict_export_json",":","path","to","label","studio","export","file","for","predict","data_folder",":","path","to","label","studio","data","folder","train_data_folder",":","path","to","label","studio","data","folder","for","train","data","set",",","overrides","data_folder","if","specified","val_data_folder",":","path","to","label","studio","data","folder","for","validation","data","test_data_folder",":","path","to","label","studio","data","folder","for","test","data","predict_data_folder",":","path","to","label","studio","data","folder","for","predict","data","input_cls",":","The",":","class",":","`","~flash.core.data.io.input.Input","`","type","to","use","for","loading","the","data",".","transform",":","The",":","class",":","`","~flash.core.data.io.input_transform.InputTransform","`","type","to","use",".","transform_kwargs",":","Dict","of","keyword","arguments","to","be","provided","when","instantiating","the","transforms",".","val_split",":","The","``","val_split","``","argument","to","pass","to","the",":","class",":","`","~flash.core.data.data_module.DataModule","`",".","multi_label",":","Whether","the","labels","are","multi","encoded",".","data_module_kwargs",":","Additional","keyword","arguments","to","use","when","constructing","the","datamodule",".","Returns",":","The","constructed","data","module","."]
code: def from_labelstudio(
      cls,
      export_json: str = None,
      train_export_json: str = None,
      val_export_json: str = None,
      test_export_json: str = None,
      predict_export_json: str = None,
      data_folder: str = None,
      train_data_folder: str = None,
      val_data_folder: str = None,
      test_data_folder: str = None,
      predict_data_folder: str = None,
      input_cls: Type[Input] = LabelStudioTextClassificationInput,
      transform: Optional[Dict[str, Callable]] = InputTransform,
      transform_kwargs: Optional[Dict] = None,
      val_split: Optional[float] = None,
      multi_label: Optional[bool] = False,
      **data_module_kwargs: Any,
  ) -> "TextClassificationData":
      """Creates a :class:`~flash.core.data.data_module.DataModule` object from the given export file and data
      directory using the :class:`~flash.core.data.io.input.Input` of name
      :attr:`~flash.core.data.io.input.InputFormat.FOLDERS` from the passed or constructed
      :class:`~flash.core.data.io.input_transform.InputTransform`.
  
      Args:
          export_json: path to label studio export file
          train_export_json: path to label studio export file for train set, overrides export_json if specified
          val_export_json: path to label studio export file for validation
          test_export_json: path to label studio export file for test
          predict_export_json: path to label studio export file for predict
          data_folder: path to label studio data folder
          train_data_folder: path to label studio data folder for train data set, overrides data_folder if specified
          val_data_folder: path to label studio data folder for validation data
          test_data_folder: path to label studio data folder for test data
          predict_data_folder: path to label studio data folder for predict data
          input_cls: The :class:`~flash.core.data.io.input.Input` type to use for loading the data.
          transform: The :class:`~flash.core.data.io.input_transform.InputTransform` type to use.
          transform_kwargs: Dict of keyword arguments to be provided when instantiating the transforms.
          val_split: The ``val_split`` argument to pass to the :class:`~flash.core.data.data_module.DataModule`.
          multi_label: Whether the labels are multi encoded.
          data_module_kwargs: Additional keyword arguments to use when constructing the datamodule.
  
      Returns:
          The constructed data module.
  
      """
  
      (
          train_data,
          val_data,
          test_data,
          predict_data,
      ) = _parse_labelstudio_arguments(
          export_json=export_json,
          train_export_json=train_export_json,
          val_export_json=val_export_json,
          test_export_json=test_export_json,
          predict_export_json=predict_export_json,
          data_folder=data_folder,
          train_data_folder=train_data_folder,
          val_data_folder=val_data_folder,
          test_data_folder=test_data_folder,
          predict_data_folder=predict_data_folder,
          val_split=val_split,
          multi_label=multi_label,
      )
  
      ds_kw = {}
  
      train_input = input_cls(
          RunningStage.TRAINING, train_data, **ds_kw
      )
      ds_kw["parameters"] = getattr(train_input, "parameters", None)
  
      return cls(
          train_input,
          input_cls(RunningStage.VALIDATING, val_data, **ds_kw),
          input_cls(RunningStage.TESTING, test_data, **ds_kw),
          input_cls(RunningStage.PREDICTING, predict_data, **ds_kw),
          transform=transform,
          transform_kwargs=transform_kwargs,
          **data_module_kwargs,
      )
  
file_path: lightning-flash/src/flash/text/classification/data.py
imports: from typing import Any, Callable, Dict, List, Optional, Sequence, Type, Union
  from pandas.core.frame import DataFrame
  from flash.core.data.data_module import DataModule
  from flash.core.data.io.input import Input
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.utilities.classification import TargetFormatter
  from flash.core.data.utilities.paths import PATH_TYPE
  from flash.core.integrations.labelstudio.input import LabelStudioTextClassificationInput, _parse_labelstudio_arguments
  from flash.core.utilities.imports import _TOPIC_TEXT_AVAILABLE
  from flash.core.utilities.stages import RunningStage
  from flash.text.classification.input import TextClassificationCSVInput, TextClassificationDataFrameInput, TextClassificationInput, TextClassificationJSONInput, TextClassificationListInput, TextClassificationParquetInput
label_desc: Use image node_id 7 for calling the TextClassificationData obj's underlying member method code with example usage: obj.from_labelstudio(cls, export_json, train_export_json, val_export_json, test_export_json, predict_export_json, data_folder, train_data_folder, val_data_folder, test_data_folder, predict_data_folder, input_cls, transform, transform_kwargs, val_split, multi_label) and returns: cls