class LayoutAlignerForText extends Transformer with HasInputAnnotationCols with HasOutputAnnotationCol with DefaultParamsWritable

LayoutAlignerForText rebuilds final text by combining document chunks and generated image captions produced by multimodal models.

It is designed to consume aligned_doc + image_caption pairs (for example, after LayoutAlignerForVision + AutoGGUFVisionModel) and emit a coherent document where captions are inserted around their best matching text blocks.

DISCLAIMER: By default, input columns (aligned_doc, image_caption) are not preserved. This stage groups and can explode rows while rebuilding text, so input row cardinality does not reliably match output row cardinality. Keeping passthrough inputs in that mode can produce misleading repeated values. Set preserveColumns = true to try to keep grouped input annotations when you explicitly need them for inspection.

Linear Supertypes
DefaultParamsWritable, MLWritable, HasOutputAnnotationCol, HasInputAnnotationCols, Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LayoutAlignerForText
  2. DefaultParamsWritable
  3. MLWritable
  4. HasOutputAnnotationCol
  5. HasInputAnnotationCols
  6. Transformer
  7. PipelineStage
  8. Logging
  9. Params
  10. Serializable
  11. Serializable
  12. Identifiable
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LayoutAlignerForText()

    Constructor used by Spark ML during deserialization.

  2. new LayoutAlignerForText(uid: String)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T
    Attributes
    protected
    Definition Classes
    Params
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  7. final def clear(param: Param[_]): LayoutAlignerForText.this.type
    Definition Classes
    Params
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  9. def copy(extra: ParamMap): Transformer

    Standard Spark ML copy implementation.

    Standard Spark ML copy implementation.

    Definition Classes
    LayoutAlignerForText → Transformer → PipelineStage → Params
  10. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  11. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  15. def explainParams(): String
    Definition Classes
    Params
  16. val explodeElements: BooleanParam

    Controls row emission mode.

    Controls row emission mode.

    When true, one output row is emitted per aligned element. When false, one output row is emitted per file with a single merged document annotation.

  17. final val extraInputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  18. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  19. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  24. def getInputCols: Array[String]

    returns

    input annotations columns currently used

    Definition Classes
    HasInputAnnotationCols
  25. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  26. final def getOutputCol: String

    Gets annotation column name going to generate

    Gets annotation column name going to generate

    Definition Classes
    HasOutputAnnotationCol
  27. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  28. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  29. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  32. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  33. val inlinePrefixThreshold: IntParam

    Threshold used to decide if inline captions should be prefixed before paragraph text.

  34. val inputAnnotatorTypes: Array[String]

    This stage consumes two DOCUMENT inputs: aligned text chunks and generated captions.

    This stage consumes two DOCUMENT inputs: aligned text chunks and generated captions.

    Definition Classes
    LayoutAlignerForTextHasInputAnnotationCols
  35. final val inputCols: StringArrayParam

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  36. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  37. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  38. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  39. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  40. val joinDelimiter: Param[String]

    Delimiter used when joining text/caption pieces into one rebuilt element string.

  41. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  42. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  44. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  47. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  48. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  49. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  50. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  52. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  54. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  55. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  56. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  57. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  58. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  59. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  60. val preserveColumns: BooleanParam

    Controls whether input annotation columns are preserved in the final output.

    Controls whether input annotation columns are preserved in the final output.

    When true, input columns are preserved by aggregating all original input annotation rows that contributed to a rebuilt group. When false, input annotation columns are dropped so outputCol is the authoritative text output and stale passthrough values are avoided.

  61. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  62. final def set(paramPair: ParamPair[_]): LayoutAlignerForText.this.type
    Attributes
    protected
    Definition Classes
    Params
  63. final def set(param: String, value: Any): LayoutAlignerForText.this.type
    Attributes
    protected
    Definition Classes
    Params
  64. final def set[T](param: Param[T], value: T): LayoutAlignerForText.this.type
    Definition Classes
    Params
  65. final def setDefault(paramPairs: ParamPair[_]*): LayoutAlignerForText.this.type
    Attributes
    protected
    Definition Classes
    Params
  66. final def setDefault[T](param: Param[T], value: T): LayoutAlignerForText.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  67. def setExplodeElements(value: Boolean): LayoutAlignerForText.this.type

    Enables/disables one-row-per-element output mode.

  68. def setExtraInputCols(value: Array[String]): LayoutAlignerForText.this.type
    Definition Classes
    HasInputAnnotationCols
  69. def setInlinePrefixThreshold(value: Int): LayoutAlignerForText.this.type

    Sets the inline X threshold for prefix insertion.

  70. final def setInputCols(value: String*): LayoutAlignerForText.this.type
    Definition Classes
    HasInputAnnotationCols
  71. def setInputCols(value: Array[String]): LayoutAlignerForText.this.type

    Overrides required annotators column if different than default

    Overrides required annotators column if different than default

    Definition Classes
    HasInputAnnotationCols
  72. def setJoinDelimiter(value: String): LayoutAlignerForText.this.type

    Sets the delimiter used between rebuilt pieces.

  73. final def setOutputCol(value: String): LayoutAlignerForText.this.type

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  74. def setPreserveColumns(value: Boolean): LayoutAlignerForText.this.type

    Enables/disables preservation of input annotation columns.

  75. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  76. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  77. def transform(dataset: Dataset[_]): DataFrame

    Executes the transformation: 1) validate schema and resolve input columns 2) aggregate (aligned_doc, image_caption) pairs 3) rebuild coherent text blocks 4) optionally preserve original input columns 5) re-attach Spark NLP annotation metadata

    Executes the transformation: 1) validate schema and resolve input columns 2) aggregate (aligned_doc, image_caption) pairs 3) rebuild coherent text blocks 4) optionally preserve original input columns 5) re-attach Spark NLP annotation metadata

    Definition Classes
    LayoutAlignerForText → Transformer
  78. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  79. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  80. def transformSchema(schema: StructType): StructType

    Computes the output schema:

    Computes the output schema:

    • always adds/overwrites outputCol as DOCUMENT annotations
    • drops input annotation columns unless preserveColumns=true
    Definition Classes
    LayoutAlignerForText → PipelineStage
  81. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  82. val uid: String
    Definition Classes
    LayoutAlignerForText → Identifiable
  83. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  84. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  86. def write: MLWriter
    Definition Classes
    DefaultParamsWritable → MLWritable

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from Transformer

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Ungrouped