code: def embedding_preprocessor(data, text):
      full_pipeline = ColumnTransformer([], remainder="passthrough")
      if len(text) != 0:
          # Each text col needs a separate pipeline
          for x in range(len(text)):
              full_pipeline.transformers.append(
                  (
                      f"text_{x}",
                      Pipeline(
                          [
                              (
                                  "test",
                                  FunctionTransformer(
                                      lambda x: np.reshape(
                                          x.to_numpy(), (-1, 1)
                                      )
                                  ),
                              ),
                              (
                                  "imputer",
                                  SimpleImputer(
                                      strategy="constant", fill_value=""
                                  ),
                              ),
                              (
                                  "raveler",
                                  FunctionTransformer(
                                      lambda x: x.ravel(),
                                      accept_sparse=True,
                                  ),
                              ),
                              ("vect", TfidfVectorizer()),
                              (
                                  "densifier",
                                  FunctionTransformer(
                                      lambda x: x.todense(),
                                      accept_sparse=True,
                                  ),
                              ),
                              (
                                  "embedder",
                                  FunctionTransformer(
                                      textembedder, accept_sparse=True
                                  ),
                              ),
                          ]
                      ),
                      text[x],
                  )
              )
  
      data_dict = {}
      data_dict["train"] = data
      train = full_pipeline.fit_transform(data_dict["train"])
      # test = full_pipeline.transform(data['test'])
  
      # Ternary clause because when running housing.csv,
      # the product of preprocessing is np array, but not when using landslide
      # data... not sure why
      final_data = pd.DataFrame(
          (
              train.toarray()
              if not isinstance(train, np.ndarray)
              else train
          ),
          columns=data.columns,
      )
  
      return final_data
  
imports: from pandas.api.types import is_numeric_dtype
  import numpy
  import pandas
  from sklearn.compose import ColumnTransformer
  from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.pipeline import Pipeline
  from nltk.stem import WordNetLemmatizer
  from nltk.tokenize import word_tokenize
  from nltk.corpus import stopwords
  from autocorrect import Speller
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.preprocessing import OrdinalEncoder
  from sklearn.impute import SimpleImputer
  from sklearn.ensemble import RandomForestRegressor
  from nylon.preprocessing.preprocessing import process_dates
  from sklearn.preprocessing import OneHotEncoder, StandardScaler, FunctionTransformer, LabelEncoder
label_desc: Use image node_id 12 for calling a global function with example usage: embedding_preprocessor(data, text) and returns: final_data