def test_input_labelstudio_text():
    """Test creation of LabelStudioTextClassificationInput and Datamodule from text."""
    download_data("https://label-studio-testdata.s3.us-east-2.amazonaws.com/lightning-flash/text_data.zip", "./data/")
    data = {
        "data_folder": "data/upload/",
        "export_json": "data/project.json",
        "multi_label": False,
    }

    train_data, test_data = LabelStudioInput._split_train_test_data(data)
    train_data, val_data = LabelStudioInput._split_train_val_data(train_data, split=0.2)
    train = LabelStudioTextClassificationInput(RunningStage.TRAINING, train_data)
    val = LabelStudioTextClassificationInput(RunningStage.VALIDATING, val_data, parameters=train.parameters)
    test = LabelStudioTextClassificationInput(RunningStage.TESTING, test_data, parameters=train.parameters)

    train_sample = train[0]
    val_sample = val[0]
    assert train_sample
    assert val_sample
    assert len(test) == 0
Test creation of LabelStudioTextClassificationInput and Datamodule from text.
tests/core/integrations/labelstudio/test_labelstudio.py