def from_parquet(
        cls,
        input_field: str,
        target_fields: Optional[Union[str, Sequence[str]]] = None,
        train_file: Optional[PATH_TYPE] = None,
        val_file: Optional[PATH_TYPE] = None,
        test_file: Optional[PATH_TYPE] = None,
        predict_file: Optional[PATH_TYPE] = None,
        target_formatter: Optional[TargetFormatter] = None,
        input_cls: Type[Input] = TextClassificationParquetInput,
        transform: Optional[Dict[str, Callable]] = InputTransform,
        transform_kwargs: Optional[Dict] = None,
        **data_module_kwargs: Any,
    ) -> "TextClassificationData":
        """Load the :class:`~flash.text.classification.data.TextClassificationData` from PARQUET files containing text
        snippets and their corresponding targets.

        Input text snippets will be extracted from the ``input_field`` column in the PARQUET files.
        The targets will be extracted from the ``target_fields`` in the PARQUET files and can be in any of our
        :ref:`supported classification target formats <formatting_classification_targets>`.
        To learn how to customize the transforms applied for each stage, read our
        :ref:`customizing transforms guide <customizing_transforms>`.

        Args:
            input_field: The field (column name) in the PARQUET files containing the text snippets.
            target_fields: The field (column name) or list of fields in the PARQUET files containing the targets.
            train_file: The PARQUET file to use when training.
            val_file: The PARQUET file to use when validating.
            test_file: The PARQUET file to use when testing.
            predict_file: The PARQUET file to use when predicting.
            target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter` to
                control how targets are handled. See :ref:`formatting_classification_targets` for more details.
            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.
            data_module_kwargs: Additional keyword arguments to provide to the
                :class:`~flash.core.data.data_module.DataModule` constructor.

        Returns:
            The constructed :class:`~flash.text.classification.data.TextClassificationData`.

        Examples
        ________

        .. testsetup::

            >>> import os
            >>> from pandas import DataFrame
            >>> DataFrame.from_dict({
            ...     "reviews": ["Best movie ever!", "Not good", "Fine I guess"],
            ...     "targets": ["positive", "negative", "neutral"],
            ... }).to_parquet("train_data.parquet", index=False)
            >>> DataFrame.from_dict({
            ...     "reviews": ["Worst movie ever!", "I didn't enjoy it", "It was ok"],
            ... }).to_parquet("predict_data.parquet", index=False)

        The file ``train_data.parquet`` contains the following contents encoded in the PARQUET format:

        .. code-block::

            reviews,targets
            Best movie ever!,positive
            Not good,negative
            Fine I guess,neutral

        The file ``predict_data.parquet`` contains the following contents encoded in the PARQUET format:

        .. code-block::

            reviews
            Worst movie ever!
            I didn't enjoy it
            It was ok

        .. doctest::

            >>> from flash import Trainer
            >>> from flash.text import TextClassifier, TextClassificationData
            >>> datamodule = TextClassificationData.from_parquet(
            ...     "reviews",
            ...     "targets",
            ...     train_file="train_data.parquet",
            ...     predict_file="predict_data.parquet",
            ...     batch_size=2,
            ... )  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            <BLANKLINE>
            ...
            >>> datamodule.num_classes
            3
            >>> datamodule.labels
            ['negative', 'neutral', 'positive']
            >>> model = TextClassifier(num_classes=datamodule.num_classes, backbone="prajjwal1/bert-tiny")
            >>> trainer = Trainer(fast_dev_run=True)
            >>> trainer.fit(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Training...
            >>> trainer.predict(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Predicting...

        .. testcleanup::

            >>> os.remove("train_data.parquet")
            >>> os.remove("predict_data.parquet")

        """
        ds_kw = {
            "target_formatter": target_formatter,
            "input_key": input_field,
            "target_keys": target_fields,
        }

        train_input = input_cls(RunningStage.TRAINING, train_file, **ds_kw)
        ds_kw["target_formatter"] = getattr(train_input, "target_formatter", None)

        return cls(
            train_input,
            input_cls(RunningStage.VALIDATING, val_file, **ds_kw),
            input_cls(RunningStage.TESTING, test_file, **ds_kw),
            input_cls(RunningStage.PREDICTING, predict_file, **ds_kw),
            transform=transform,
            transform_kwargs=transform_kwargs,
            **data_module_kwargs,
        )
Load the :class:`~flash.text.classification.data.TextClassificationData` from PARQUET files containing text
        snippets and their corresponding targets.

        Input text snippets will be extracted from the ``input_field`` column in the PARQUET files.
        The targets will be extracted from the ``target_fields`` in the PARQUET files and can be in any of our
        :ref:`supported classification target formats <formatting_classification_targets>`.
        To learn how to customize the transforms applied for each stage, read our
        :ref:`customizing transforms guide <customizing_transforms>`.

        Args:
            input_field: The field (column name) in the PARQUET files containing the text snippets.
            target_fields: The field (column name) or list of fields in the PARQUET files containing the targets.
            train_file: The PARQUET file to use when training.
            val_file: The PARQUET file to use when validating.
            test_file: The PARQUET file to use when testing.
            predict_file: The PARQUET file to use when predicting.
            target_formatter: Optionally provide a :class:`~flash.core.data.utilities.classification.TargetFormatter` to
                control how targets are handled. See :ref:`formatting_classification_targets` for more details.
            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.
            data_module_kwargs: Additional keyword arguments to provide to the
                :class:`~flash.core.data.data_module.DataModule` constructor.

        Returns:
            The constructed :class:`~flash.text.classification.data.TextClassificationData`.

        Examples
        ________

        .. testsetup::

            >>> import os
            >>> from pandas import DataFrame
            >>> DataFrame.from_dict({
            ...     "reviews": ["Best movie ever!", "Not good", "Fine I guess"],
            ...     "targets": ["positive", "negative", "neutral"],
            ... }).to_parquet("train_data.parquet", index=False)
            >>> DataFrame.from_dict({
            ...     "reviews": ["Worst movie ever!", "I didn't enjoy it", "It was ok"],
            ... }).to_parquet("predict_data.parquet", index=False)

        The file ``train_data.parquet`` contains the following contents encoded in the PARQUET format:

        .. code-block::

            reviews,targets
            Best movie ever!,positive
            Not good,negative
            Fine I guess,neutral

        The file ``predict_data.parquet`` contains the following contents encoded in the PARQUET format:

        .. code-block::

            reviews
            Worst movie ever!
            I didn't enjoy it
            It was ok

        .. doctest::

            >>> from flash import Trainer
            >>> from flash.text import TextClassifier, TextClassificationData
            >>> datamodule = TextClassificationData.from_parquet(
            ...     "reviews",
            ...     "targets",
            ...     train_file="train_data.parquet",
            ...     predict_file="predict_data.parquet",
            ...     batch_size=2,
            ... )  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            <BLANKLINE>
            ...
            >>> datamodule.num_classes
            3
            >>> datamodule.labels
            ['negative', 'neutral', 'positive']
            >>> model = TextClassifier(num_classes=datamodule.num_classes, backbone="prajjwal1/bert-tiny")
            >>> trainer = Trainer(fast_dev_run=True)
            >>> trainer.fit(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Training...
            >>> trainer.predict(model, datamodule=datamodule)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
            Predicting...

        .. testcleanup::

            >>> os.remove("train_data.parquet")
            >>> os.remove("predict_data.parquet")

        
src/flash/text/classification/data.py