com.johnsnowlabs.nlp.embeddings
BiEncoderMultimodalEmbeddings
Companion object BiEncoderMultimodalEmbeddings
class BiEncoderMultimodalEmbeddings extends Transformer with HasInputAnnotationCols with HasOutputAnnotatorType with HasOutputAnnotationCol with HasImageFeatureProperties with HasEngine with WriteOnnxModel
Dual-encoder multimodal embeddings annotator.
The output is written to two derived columns based on outputCol:
${outputCol}_doc_embeddings and ${outputCol}_image_embeddings.
- Grouped
- Alphabetic
- By Inheritance
- BiEncoderMultimodalEmbeddings
- WriteOnnxModel
- HasEngine
- HasImageFeatureProperties
- ParamsAndFeaturesWritable
- HasFeatures
- DefaultParamsWritable
- MLWritable
- HasOutputAnnotationCol
- HasOutputAnnotatorType
- HasInputAnnotationCols
- Transformer
- PipelineStage
- Logging
- Params
- Serializable
- Serializable
- Identifiable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Type Members
-
type
AnnotatorType = String
- Definition Classes
- HasOutputAnnotatorType
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
$[T](param: Param[T]): T
- Attributes
- protected
- Definition Classes
- Params
-
def
$$[T](feature: StructFeature[T]): T
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[K, V](feature: MapFeature[K, V]): Map[K, V]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[T](feature: SetFeature[T]): Set[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[T](feature: ArrayFeature[T]): Array[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val addedTokens: MapFeature[String, Int]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val batchSize: IntParam
- val bosTokenId: IntParam
-
final
def
checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
final
def
clear(param: Param[_]): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- Params
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copy(extra: ParamMap): Transformer
- Definition Classes
- BiEncoderMultimodalEmbeddings → Transformer → PipelineStage → Params
-
def
copyValues[T <: Params](to: T, extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
-
final
def
defaultCopy[T <: Params](extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
-
val
doNormalize: BooleanParam
Whether or not to normalize the input with mean and standard deviation
Whether or not to normalize the input with mean and standard deviation
- Definition Classes
- HasImageFeatureProperties
-
val
doResize: BooleanParam
Whether to resize the input to a certain size
Whether to resize the input to a certain size
- Definition Classes
- HasImageFeatureProperties
-
val
engine: Param[String]
This param is set internally once via loadSavedModel.
This param is set internally once via loadSavedModel. That's why there is no setter
- Definition Classes
- HasEngine
- val eosTokenId: IntParam
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
explainParam(param: Param[_]): String
- Definition Classes
- Params
-
def
explainParams(): String
- Definition Classes
- Params
-
final
val
extraInputCols: StringArrayParam
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
final
def
extractParamMap(): ParamMap
- Definition Classes
- Params
-
final
def
extractParamMap(extra: ParamMap): ParamMap
- Definition Classes
- Params
-
val
featureExtractorType: Param[String]
Name of model's architecture for feature extraction
Name of model's architecture for feature extraction
- Definition Classes
- HasImageFeatureProperties
-
val
features: ArrayBuffer[Feature[_, _, _]]
- Definition Classes
- HasFeatures
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get[T](feature: StructFeature[T]): Option[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[T](feature: SetFeature[T]): Option[Set[T]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[T](feature: ArrayFeature[T]): Option[Array[T]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
get[T](param: Param[T]): Option[T]
- Definition Classes
- Params
- def getAddedTokens: Map[String, Int]
- def getBatchSize: Int
- def getBosTokenId: Int
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
getDefault[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getDoNormalize: Boolean
- Definition Classes
- HasImageFeatureProperties
-
def
getDoResize: Boolean
- Definition Classes
- HasImageFeatureProperties
-
def
getEngine: String
- Definition Classes
- HasEngine
- def getEosTokenId: Int
-
def
getFeatureExtractorType: String
- Definition Classes
- HasImageFeatureProperties
- def getImageDataFile: Option[String]
-
def
getImageMean: Array[Double]
- Definition Classes
- HasImageFeatureProperties
- def getImageModelFile: String
- def getImagePromptFixTokenIds: Array[Int]
-
def
getImageStd: Array[Double]
- Definition Classes
- HasImageFeatureProperties
- def getImageTokenId: Int
-
def
getInputCols: Array[String]
- returns
input annotations columns currently used
- Definition Classes
- HasInputAnnotationCols
- def getInstruction: String
- def getMaxPixels: Int
- def getMerges: Map[(String, String), Int]
- def getMinPixels: Int
-
final
def
getOrDefault[T](param: Param[T]): T
- Definition Classes
- Params
-
final
def
getOutputCol: String
Gets annotation column name going to generate
Gets annotation column name going to generate
- Definition Classes
- HasOutputAnnotationCol
- def getOutputDocEmbeddingsCol: String
- def getOutputImageEmbeddingsCol: String
- def getPadTokenId: Int
-
def
getParam(paramName: String): Param[Any]
- Definition Classes
- Params
- def getPatchSize: Int
-
def
getResample: Int
- Definition Classes
- HasImageFeatureProperties
-
def
getSize: Int
- Definition Classes
- HasImageFeatureProperties
- def getSpatialMergeSize: Int
- def getTemporalPatchSize: Int
- def getTextDataFile: Option[String]
- def getTextModelFile: String
- def getVocabulary: Map[String, Int]
-
final
def
hasDefault[T](param: Param[T]): Boolean
- Definition Classes
- Params
-
def
hasParam(paramName: String): Boolean
- Definition Classes
- Params
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val imageDataFile: Param[String]
-
val
imageMean: DoubleArrayParam
The sequence of means for each channel, to be used when normalizing images
The sequence of means for each channel, to be used when normalizing images
- Definition Classes
- HasImageFeatureProperties
- val imageModelFile: Param[String]
- val imagePromptFixTokenIds: IntArrayParam
-
val
imageStd: DoubleArrayParam
The sequence of standard deviations for each channel, to be used when normalizing images
The sequence of standard deviations for each channel, to be used when normalizing images
- Definition Classes
- HasImageFeatureProperties
- val imageTokenId: IntParam
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
val
inputAnnotatorTypes: Array[String]
Annotator reference id.
Annotator reference id. Used to identify elements in metadata or to refer to this annotator type
- Definition Classes
- BiEncoderMultimodalEmbeddings → HasInputAnnotationCols
-
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
- val instruction: Param[String]
-
final
def
isDefined(param: Param[_]): Boolean
- Definition Classes
- Params
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isSet(param: Param[_]): Boolean
- Definition Classes
- Params
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- val maxPixels: IntParam
- val merges: MapFeature[(String, String), Int]
- val minPixels: IntParam
-
def
msgHelper(schema: StructType): String
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onWrite(path: String, spark: SparkSession): Unit
- Definition Classes
- BiEncoderMultimodalEmbeddings → ParamsAndFeaturesWritable
-
val
optionalInputAnnotatorTypes: Array[String]
- Definition Classes
- HasInputAnnotationCols
-
val
outputAnnotatorType: AnnotatorType
- Definition Classes
- BiEncoderMultimodalEmbeddings → HasOutputAnnotatorType
-
final
val
outputCol: Param[String]
- Attributes
- protected
- Definition Classes
- HasOutputAnnotationCol
- val padTokenId: IntParam
-
lazy val
params: Array[Param[_]]
- Definition Classes
- Params
- val patchSize: IntParam
-
val
resample: IntParam
An optional resampling filter.
An optional resampling filter. This can be one of PIL.Image.NEAREST, PIL.Image.BOX, PIL.Image.BILINEAR, PIL.Image.HAMMING, PIL.Image.BICUBIC or PIL.Image.LANCZOS. Only has an effect if do_resize is set to True
- Definition Classes
- HasImageFeatureProperties
-
def
save(path: String): Unit
- Definition Classes
- MLWritable
- Annotations
- @Since( "1.6.0" ) @throws( ... )
-
def
set[T](feature: StructFeature[T], value: T): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[K, V](feature: MapFeature[K, V], value: Map[K, V]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[T](feature: SetFeature[T], value: Set[T]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[T](feature: ArrayFeature[T], value: Array[T]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
set(paramPair: ParamPair[_]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set(param: String, value: Any): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set[T](param: Param[T], value: T): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- Params
- def setAddedTokens(value: Map[String, Int]): BiEncoderMultimodalEmbeddings.this.type
- def setBatchSize(value: Int): BiEncoderMultimodalEmbeddings.this.type
- def setBosTokenId(value: Int): BiEncoderMultimodalEmbeddings.this.type
-
def
setDefault[T](feature: StructFeature[T], value: () ⇒ T): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
setDefault(paramPairs: ParamPair[_]*): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
setDefault[T](param: Param[T], value: T): BiEncoderMultimodalEmbeddings.this.type
- Attributes
- protected[org.apache.spark.ml]
- Definition Classes
- Params
-
def
setDoNormalize(value: Boolean): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
-
def
setDoResize(value: Boolean): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
- def setEosTokenId(value: Int): BiEncoderMultimodalEmbeddings.this.type
-
def
setExtraInputCols(value: Array[String]): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasInputAnnotationCols
-
def
setFeatureExtractorType(value: String): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
-
def
setImageMean(value: Array[Double]): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
- def setImagePromptFixTokenIds(value: Array[Int]): BiEncoderMultimodalEmbeddings.this.type
-
def
setImageStd(value: Array[Double]): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
- def setImageTokenId(value: Int): BiEncoderMultimodalEmbeddings.this.type
-
final
def
setInputCols(value: String*): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasInputAnnotationCols
-
def
setInputCols(value: Array[String]): BiEncoderMultimodalEmbeddings.this.type
Overrides required annotators column if different than default
Overrides required annotators column if different than default
- Definition Classes
- HasInputAnnotationCols
- def setInstruction(value: String): BiEncoderMultimodalEmbeddings.this.type
- def setMaxPixels(value: Int): BiEncoderMultimodalEmbeddings.this.type
- def setMerges(value: Map[(String, String), Int]): BiEncoderMultimodalEmbeddings.this.type
- def setMinPixels(value: Int): BiEncoderMultimodalEmbeddings.this.type
-
final
def
setOutputCol(value: String): BiEncoderMultimodalEmbeddings.this.type
Overrides annotation column name when transforming
Overrides annotation column name when transforming
- Definition Classes
- HasOutputAnnotationCol
- def setPadTokenId(value: Int): BiEncoderMultimodalEmbeddings.this.type
- def setPatchSize(value: Int): BiEncoderMultimodalEmbeddings.this.type
-
def
setResample(value: Int): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
-
def
setSize(value: Int): BiEncoderMultimodalEmbeddings.this.type
- Definition Classes
- HasImageFeatureProperties
- def setSpatialMergeSize(value: Int): BiEncoderMultimodalEmbeddings.this.type
- def setTemporalPatchSize(value: Int): BiEncoderMultimodalEmbeddings.this.type
- def setVocabulary(value: Map[String, Int]): BiEncoderMultimodalEmbeddings.this.type
-
val
size: IntParam
Resize the input to the given size.
Resize the input to the given size. If a tuple is provided, it should be (width, height). If only an integer is provided, then the input will be resized to (size, size). Only has an effect if do_resize is set to True.
- Definition Classes
- HasImageFeatureProperties
- val spatialMergeSize: IntParam
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val temporalPatchSize: IntParam
- val textDataFile: Param[String]
- val textModelFile: Param[String]
-
def
toString(): String
- Definition Classes
- Identifiable → AnyRef → Any
-
def
transform(dataset: Dataset[_]): DataFrame
- Definition Classes
- BiEncoderMultimodalEmbeddings → Transformer
-
def
transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" )
-
def
transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" ) @varargs()
-
def
transformSchema(schema: StructType): StructType
- Definition Classes
- BiEncoderMultimodalEmbeddings → PipelineStage
-
def
transformSchema(schema: StructType, logging: Boolean): StructType
- Attributes
- protected
- Definition Classes
- PipelineStage
- Annotations
- @DeveloperApi()
-
val
uid: String
- Definition Classes
- BiEncoderMultimodalEmbeddings → Identifiable
- val vocabulary: MapFeature[String, Int]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write: MLWriter
- Definition Classes
- ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
-
def
writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: OnnxWrapper, suffix: String, fileName: String): Unit
- Definition Classes
- WriteOnnxModel
-
def
writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(OnnxWrapper, String)], suffix: String): Unit
- Definition Classes
- WriteOnnxModel