class_docstr: AutoKeras text regression class.
  
  # Arguments
      output_dim: Int. The number of output dimensions. Defaults to None.
          If None, it will be inferred from the data.
      loss: A Keras loss function. Defaults to use 'mean_squared_error'.
      metrics: A list of Keras metrics. Defaults to use 'mean_squared_error'.
      project_name: String. The name of the AutoModel.
          Defaults to 'text_regressor'.
      max_trials: Int. The maximum number of different Keras Models to try.
          The search may finish before reaching the max_trials. Defaults to
          100.
      directory: String. The path to a directory for storing the search
          outputs. Defaults to None, which would create a folder with the
          name of the AutoModel in the current directory.
      objective: String. Name of model metric to minimize
          or maximize, e.g. 'val_accuracy'. Defaults to 'val_loss'.
      tuner: String or subclass of AutoTuner. If string, it should be one of
          'greedy', 'bayesian', 'hyperband' or 'random'. It can also be a
          subclass of AutoTuner. If left unspecified, it uses a task specific
          tuner, which first evaluates the most commonly used models for the
          task before exploring other models.
      overwrite: Boolean. Defaults to `False`. If `False`, reloads an existing
          project of the same name if one is found. Otherwise, overwrites the
          project.
      seed: Int. Random seed.
      max_model_size: Int. Maximum number of scalars in the parameters of a
          model. Models larger than this are rejected.
      **kwargs: Any arguments supported by AutoModel.
class_docstr_tok: ["AutoKeras","text","regression","class",".","#","Arguments","output_dim",":","Int",".","The","number","of","output","dimensions",".","Defaults","to","None",".","If","None",",","it","will","be","inferred","from","the","data",".","loss",":","A","Keras","loss","function",".","Defaults","to","use","'mean_squared_error","'",".","metrics",":","A","list","of","Keras","metrics",".","Defaults","to","use","'mean_squared_error","'",".","project_name",":","String",".","The","name","of","the","AutoModel",".","Defaults","to","'text_regressor","'",".","max_trials",":","Int",".","The","maximum","number","of","different","Keras","Models","to","try",".","The","search","may","finish","before","reaching","the","max_trials",".","Defaults","to","100.","directory",":","String",".","The","path","to","a","directory","for","storing","the","search","outputs",".","Defaults","to","None",",","which","would","create","a","folder","with","the","name","of","the","AutoModel","in","the","current","directory",".","objective",":","String",".","Name","of","model","metric","to","minimize","or","maximize",",","e.g",".","'val_accuracy","'",".","Defaults","to","'val_loss","'",".","tuner",":","String","or","subclass","of","AutoTuner",".","If","string",",","it","should","be","one","of","'greedy","'",",","'bayesian","'",",","'hyperband","'","or","'random","'",".","It","can","also","be","a","subclass","of","AutoTuner",".","If","left","unspecified",",","it","uses","a","task","specific","tuner",",","which","first","evaluates","the","most","commonly","used","models","for","the","task","before","exploring","other","models",".","overwrite",":","Boolean",".","Defaults","to","`","False","`",".","If","`","False","`",",","reloads","an","existing","project","of","the","same","name","if","one","is","found",".","Otherwise",",","overwrites","the","project",".","seed",":","Int",".","Random","seed",".","max_model_size",":","Int",".","Maximum","number","of","scalars","in","the","parameters","of","a","model",".","Models","larger","than","this","are","rejected",".","*","*","kwargs",":","Any","arguments","supported","by","AutoModel","."]
code: def __init__(
      self,
      output_dim: Optional[int] = None,
      loss: types.LossType = "mean_squared_error",
      metrics: Optional[types.MetricsType] = None,
      project_name: str = "text_regressor",
      max_trials: int = 100,
      directory: Union[str, Path, None] = None,
      objective: str = "val_loss",
      tuner: Union[str, Type[tuner.AutoTuner]] = None,
      overwrite: bool = False,
      seed: Optional[int] = None,
      max_model_size: Optional[int] = None,
      **kwargs,
  ):
      if tuner is None:
          tuner = greedy.Greedy
      super().__init__(
          outputs=blocks.RegressionHead(
              output_dim=output_dim, loss=loss, metrics=metrics
          ),
          max_trials=max_trials,
          directory=directory,
          project_name=project_name,
          objective=objective,
          tuner=tuner,
          overwrite=overwrite,
          seed=seed,
          max_model_size=max_model_size,
          **kwargs,
      )
  
imports: from pathlib import Path
  from typing import Optional
  from typing import Type
  from typing import Union
  from autokeras import auto_model
  from autokeras import blocks
  from autokeras import nodes
  from autokeras.engine import tuner
  from autokeras.tuners import greedy
  from autokeras.tuners import task_specific
  from autokeras.utils import types
label_desc: Use image node_id 1 to create a new TextRegressor object from inherited base classes: SupervisedTextPipeline with example: obj = TextRegressor(output_dim, loss, metrics, project_name, max_trials, directory, objective, tuner, overwrite, seed, max_model_size)