code: def infer_problem_type(
      y_train_data: Optional[pd.DataFrame] = None,
      provided_problem_type: Optional[str] = None,
  ) -> str:
      """
      Infer the basic (binary, multiclass, and regression) problem types if problem type is None or classification.
      Only training data are used. Assume users provide valid validation data.
  
      Parameters
      ----------
      y_train_data
          The label column of training data.
      provided_problem_type
          Provided problem type
  
      Returns
      -------
      Inferred problem type
      """
      if provided_problem_type in [None, CLASSIFICATION]:
          problem_type = infer_basic_problem_type(y=y_train_data)
          # trust users' prior knowledge
          if (
              provided_problem_type == CLASSIFICATION
              and problem_type == REGRESSION
          ):
              problem_type = MULTICLASS
      else:
          problem_type = provided_problem_type
  
      return problem_type
  
imports: import collections
  import json
  import logging
  import warnings
  from io import BytesIO
  from typing import Dict, List, Optional, Tuple, Union
  import pandas
  import PIL
  import pytesseract
  from autogluon.core.utils import infer_problem_type
  from ..constants import BINARY, CATEGORICAL, CLASSIFICATION, DOCUMENT_IMAGE, DOCUMENT_PDF, IDENTIFIER, IMAGE, IMAGE_BYTEARRAY, IMAGE_PATH, MULTICLASS, NER, NER_ANNOTATION, NULL, NUMERICAL, OBJECT_DETECTION, OPEN_VOCABULARY_OBJECT_DETECTION, REGRESSION, ROIS, SEMANTIC_SEGMENTATION, SEMANTIC_SEGMENTATION_GT, SEMANTIC_SEGMENTATION_IMG, TEXT, TEXT_NER
  from .utils import is_rois_input
label_desc: Use image node_id 14 for calling a global function with example usage: infer_problem_type(y_train_data, provided_problem_type) and returns: problem_type