Packages

class PretrainedZeroShotMultiTask extends AnnotatorModel[PretrainedZeroShotMultiTask] with ParamsAndFeaturesWritable with HasBatchedAnnotate[PretrainedZeroShotMultiTask] with InternalWriteOnnxModel with WriteSentencePieceModel with HasEngine with CheckLicense

Zero-shot multi-task information extraction.

Performs four extraction tasks simultaneously from a single document in a single forward pass:

  • **Named entity extraction** — spans of text matching a given type
  • **Relation extraction** — (head, tail) span pairs for a given relation type
  • **Classification** — document-level or sentence-level label assignment
  • **Structured extraction** — structured records with typed fields extracted from text

All tasks are defined via a compact :: DSL, described below, and can be combined freely. Tasks are zero-shot: no fine-tuning is needed.

DSL syntax

Specifications use :: as a separator. Order of optional parts is flexible.

Entities

Each entry is a string: "name", "name::dtype", "name::description", or "name::dtype::description" where dtype is "list" (default, multiple spans) or "str" (single best span).

.setEntities(Array(
  "person",                                      // list of persons
  "company::str",                                // single company
  "product::Names of products or services",      // list with description
  "price::str::Monetary value including currency" // single with dtype and description
))
Relations

Each entry is a string: "relation_name" or "relation_name::description". The model extracts (head, tail) span pairs for each relation type.

.setRelations(Array(
  "works_for",
  "located_in::The organization is physically located in the place"
))
Classifications

Each entry is a (taskSpec, Array[labelSpec]) tuple.

  • Task spec: "task_name" (single-label) or "task_name::multi" (multi-label)
  • Label spec: "label" or "label::description"
.setClassifications(Array(
  ("sentiment", Array("positive", "negative", "neutral")),
  ("topics::multi", Array("finance::Financial content", "technology", "politics"))
))
Structures

Each entry is a (structureName, Array[fieldSpec]) tuple. Fields use: "field_name", "field_name::dtype", "field_name::description", "field_name::dtype::description", or "field_name::[choice1|choice2]" (forces dtype=str).

.setStructures(Array(
  ("product_info", Array(
    "name::str",
    "price::str::Price including currency symbol",
    "features::list",
    "availability::[in_stock|pre_order|sold_out]"
  ))
))

Output

All task results are returned in a single output column as Array[Annotation]:

  • Entities → annotatorType = "chunk", result = span text, metadata contains entity, confidence, sentence
  • Classifications → annotatorType = "category", result = label, metadata contains confidence, task, sentence
  • Relations → annotatorType = "category", result = relation name, metadata contains chunk1, chunk2, entity1, entity2, entity1_begin, entity1_end, entity2_begin, entity2_end, chunk1_confidence, chunk2_confidence, sentence (compatible with com.johnsnowlabs.nlp.annotators.re.RelationExtractionDLModel output)
  • Structures → annotatorType = "struct", result = structure name, metadata contains one key per field (value is JSON-encoded: object for str fields, array for list fields) plus instance_idx and sentence

Example

val zeroShot = PretrainedZeroShotMultiTask.pretrained()
  .setInputCols("document")
  .setOutputCol("extractions")
  .setEntities(Array("person", "company::str", "product::List of products"))
  .setClassifications(Array(("sentiment", Array("positive", "negative", "neutral"))))
  .setRelations(Array("works_for", "founded"))
  .setStructures(Array(
    ("invoice", Array("vendor::str", "amount::str", "items::list"))))
  .setEntityThreshold(0.5f)
  .setRelationThreshold(0.6f)
Linear Supertypes
CheckLicense, HasEngine, WriteSentencePieceModel, InternalWriteOnnxModel, HasBatchedAnnotate[PretrainedZeroShotMultiTask], AnnotatorModel[PretrainedZeroShotMultiTask], CanBeLazy, RawAnnotator[PretrainedZeroShotMultiTask], HasOutputAnnotationCol, HasInputAnnotationCols, HasOutputAnnotatorType, ParamsAndFeaturesWritable, HasFeatures, DefaultParamsWritable, MLWritable, Model[PretrainedZeroShotMultiTask], Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. PretrainedZeroShotMultiTask
  2. CheckLicense
  3. HasEngine
  4. WriteSentencePieceModel
  5. InternalWriteOnnxModel
  6. HasBatchedAnnotate
  7. AnnotatorModel
  8. CanBeLazy
  9. RawAnnotator
  10. HasOutputAnnotationCol
  11. HasInputAnnotationCols
  12. HasOutputAnnotatorType
  13. ParamsAndFeaturesWritable
  14. HasFeatures
  15. DefaultParamsWritable
  16. MLWritable
  17. Model
  18. Transformer
  19. PipelineStage
  20. Logging
  21. Params
  22. Serializable
  23. Serializable
  24. Identifiable
  25. AnyRef
  26. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PretrainedZeroShotMultiTask()
  2. new PretrainedZeroShotMultiTask(uid: String)

    uid

    UID for the Spark ML pipeline stage

Type Members

  1. type AnnotationContent = Seq[Row]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  2. type AnnotatorType = String
    Definition Classes
    HasOutputAnnotatorType

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. def $$[T](feature: StructFeature[T]): T
    Attributes
    protected
    Definition Classes
    HasFeatures
  5. def $$[K, V](feature: MapFeature[K, V]): Map[K, V]
    Attributes
    protected
    Definition Classes
    HasFeatures
  6. def $$[T](feature: SetFeature[T]): Set[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  7. def $$[T](feature: ArrayFeature[T]): Array[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def _transform(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  10. def afterAnnotate(dataset: DataFrame): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def batchAnnotate(batchedAnnotations: Seq[Array[Annotation]]): Seq[Seq[Annotation]]
    Definition Classes
    PretrainedZeroShotMultiTask → HasBatchedAnnotate
  13. def batchProcess(rows: Iterator[_]): Iterator[Row]
    Definition Classes
    HasBatchedAnnotate
  14. val batchSize: IntParam
    Definition Classes
    HasBatchedAnnotate
  15. def beforeAnnotate(dataset: Dataset[_]): Dataset[_]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  16. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  17. def checkValidEnvironment(spark: Option[SparkSession], scopes: Seq[String], metadata: Option[Map[String, Value]]): Unit
    Definition Classes
    CheckLicense
  18. def checkValidScope(scope: String): Unit
    Definition Classes
    CheckLicense
  19. def checkValidScopeAndEnvironment(scope: String, spark: Option[SparkSession], checkLp: Boolean, metadata: Option[Map[String, Value]]): Unit
    Definition Classes
    CheckLicense
  20. def checkValidScopesAndEnvironment(scopes: Seq[String], spark: Option[SparkSession], checkLp: Boolean, metadata: Option[Map[String, Value]]): Unit
    Definition Classes
    CheckLicense
  21. val classificationThreshold: FloatParam

  22. val classifications: Param[Array[(String, Array[String])]]

    Classification tasks in DSL format.

    Classification tasks in DSL format. Each entry defines one labelling task.

    Format: Array[(taskSpec, Array[labelSpec])]

    • taskSpec"task_name" for single-label or "task_name::multi" for multi-label
    • labelSpec"label" or "label::description" for each candidate label

    For single-label tasks the model returns the highest-scoring label above the threshold. For multi-label tasks all labels above the threshold are returned.

    Examples:

    ("sentiment", Array("positive", "negative", "neutral"))
    ("sentiment::multi", Array("positive::Happy tone", "negative::Sad tone"))
    ("topic::multi", Array("finance", "technology::Tech products and companies", "politics"))
  23. final def clear(param: Param[_]): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    Params
  24. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  25. def copy(extra: ParamMap): PretrainedZeroShotMultiTask
    Definition Classes
    RawAnnotator → Model → Transformer → PipelineStage → Params
  26. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  27. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  28. val engine: Param[String]
    Definition Classes
    HasEngine
  29. val entities: StringArrayParam

    Entity specifications in DSL format.

    Entity specifications in DSL format. Each string describes one entity type to extract.

    Format: "name", "name::dtype", "name::description", or "name::dtype::description".

    • name — entity type label (used as the entity metadata key in output annotations)
    • dtype"list" (default) to extract all matching spans, or "str" to extract only the single highest-confidence span
    • description — free-text hint sent to the model to guide extraction

    Examples:

    "person"                                        // all person spans, no description
    "company::str"                                  // single best company span
    "product::Names of products or services"        // all product spans with description
    "price::str::Monetary value with currency"      // single span, dtype before description
  30. val entityThreshold: FloatParam

  31. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  33. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  34. def explainParams(): String
    Definition Classes
    Params
  35. final val extraInputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  36. def extraValidate(structType: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  37. def extraValidateMsg: String
    Attributes
    protected
    Definition Classes
    RawAnnotator
  38. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  39. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  40. val features: ArrayBuffer[Feature[_, _, _]]
    Definition Classes
    HasFeatures
  41. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  42. def get[T](feature: StructFeature[T]): Option[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  43. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  44. def get[T](feature: SetFeature[T]): Option[Set[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  45. def get[T](feature: ArrayFeature[T]): Option[Array[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  46. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  47. def getBatchSize: Int
    Definition Classes
    HasBatchedAnnotate
  48. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  49. def getClassificationThreshold: Float
  50. def getClassifications: Array[(String, Array[String])]
  51. def getClassificationsAsJava: List[List[AnyRef]]

    Java/Python-friendly getter: returns classifications as nested Java lists for Py4J.

  52. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  53. def getEngine: String
    Definition Classes
    HasEngine
  54. def getEntities: Array[String]
  55. def getEntityThreshold: Float
  56. def getInputCols: Array[String]
    Definition Classes
    HasInputAnnotationCols
  57. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  58. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  59. final def getOutputCol: String
    Definition Classes
    HasOutputAnnotationCol
  60. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  61. def getRelationThreshold: Float
  62. def getRelations: Array[String]
  63. def getStructureThreshold: Float
  64. def getStructures: Array[(String, Array[String])]
  65. def getStructuresAsJava: List[List[AnyRef]]

    Java/Python-friendly getter: returns structures as nested Java lists for Py4J.

  66. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  67. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  68. def hasParent: Boolean
    Definition Classes
    Model
  69. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  70. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  71. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  72. val inputAnnotatorTypes: Array[String]

    Input Annotator Types: DOCUMENT

    Input Annotator Types: DOCUMENT

    Definition Classes
    PretrainedZeroShotMultiTask → HasInputAnnotationCols
  73. final val inputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  74. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  75. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  76. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  77. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  78. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  79. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  80. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  81. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  82. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  83. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  84. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  85. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  86. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  87. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  88. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  89. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  90. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  91. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  92. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  93. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  94. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  95. def onWrite(path: String, spark: SparkSession): Unit
    Definition Classes
    PretrainedZeroShotMultiTask → ParamsAndFeaturesWritable
  96. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  97. val outputAnnotatorType: AnnotatorType

    Output Annotator Types: NAMED_ENTITY

    Output Annotator Types: NAMED_ENTITY

    Definition Classes
    PretrainedZeroShotMultiTask → HasOutputAnnotatorType
  98. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  99. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  100. var parent: Estimator[PretrainedZeroShotMultiTask]
    Definition Classes
    Model
  101. val relationThreshold: FloatParam

  102. val relations: StringArrayParam

    Relation specifications in DSL format.

    Relation specifications in DSL format. Each string defines one relation type to extract.

    Format: "relation_name" or "relation_name::description".

    The model extracts (head, tail) span pairs. Output annotations use annotatorType = "category" with the same metadata layout as com.johnsnowlabs.nlp.annotators.re.RelationExtractionDLModel: chunk1, chunk2, entity1, entity2, entity1_begin, entity1_end, entity2_begin, entity2_end, chunk1_confidence, chunk2_confidence.

    Examples:

    "works_for"
    "located_in::The organization is physically located in the place"
    "founded::Founding relationship between a person and an organization"
  103. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  104. def set[T](feature: StructFeature[T], value: T): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  105. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  106. def set[T](feature: SetFeature[T], value: Set[T]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  107. def set[T](feature: ArrayFeature[T], value: Array[T]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  108. final def set(paramPair: ParamPair[_]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    Params
  109. final def set(param: String, value: Any): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    Params
  110. final def set[T](param: Param[T], value: T): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    Params
  111. def setBatchSize(size: Int): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    HasBatchedAnnotate
  112. def setClassificationThreshold(value: Float): PretrainedZeroShotMultiTask.this.type

    Set minimum confidence threshold for classification (default: 0.5).

    Set minimum confidence threshold for classification (default: 0.5).

    For single-label tasks, the best label is always returned regardless of threshold. For multi-label tasks, only labels with confidence ≥ threshold are included; if none qualify the best label is returned as a fallback.

  113. def setClassifications(names: List[String], labelsPerTask: List[List[String]]): PretrainedZeroShotMultiTask.this.type

    Java/Python-friendly overload: accepts two parallel lists (task names and per-task label lists) as passed by Py4J from Python.

  114. def setClassifications(classifications: Array[(String, Array[String])]): PretrainedZeroShotMultiTask.this.type
  115. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  116. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  117. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  118. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  119. final def setDefault(paramPairs: ParamPair[_]*): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected
    Definition Classes
    Params
  120. final def setDefault[T](param: Param[T], value: T): PretrainedZeroShotMultiTask.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  121. def setEntities(entities: Array[String]): PretrainedZeroShotMultiTask.this.type
  122. def setEntityThreshold(value: Float): PretrainedZeroShotMultiTask.this.type

    Set minimum confidence threshold for entity extraction (default: 0.5).

    Set minimum confidence threshold for entity extraction (default: 0.5).

    Spans with a confidence score below this value are discarded. Applies uniformly to all entity types unless overridden per-type via schema metadata.

  123. def setExtraInputCols(value: Array[String]): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    HasInputAnnotationCols
  124. final def setInputCols(value: String*): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    HasInputAnnotationCols
  125. def setInputCols(value: Array[String]): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    HasInputAnnotationCols
  126. def setLazyAnnotator(value: Boolean): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    CanBeLazy
  127. def setModelIfNotSet(spark: SparkSession, wrappers: Gliner2Wrappers, config: Gliner2Config = Gliner2Config()): PretrainedZeroShotMultiTask
  128. final def setOutputCol(value: String): PretrainedZeroShotMultiTask.this.type
    Definition Classes
    HasOutputAnnotationCol
  129. def setParent(parent: Estimator[PretrainedZeroShotMultiTask]): PretrainedZeroShotMultiTask
    Definition Classes
    Model
  130. def setRelationThreshold(value: Float): PretrainedZeroShotMultiTask.this.type

    Set minimum confidence threshold for relation extraction (default: 0.5).

    Set minimum confidence threshold for relation extraction (default: 0.5).

    Both the head and tail spans must meet this threshold for a relation instance to be emitted.

  131. def setRelations(relations: Array[String]): PretrainedZeroShotMultiTask.this.type
  132. def setStructureThreshold(value: Float): PretrainedZeroShotMultiTask.this.type

    Set minimum confidence threshold for structure field extraction (default: 0.5).

    Set minimum confidence threshold for structure field extraction (default: 0.5).

    Applied to each field independently. Fields whose best span falls below the threshold are omitted from the instance map. Instances with no qualifying fields are discarded entirely.

  133. def setStructures(names: List[String], fieldsPerStructure: List[List[String]]): PretrainedZeroShotMultiTask.this.type

    Java/Python-friendly overload: accepts two parallel lists (structure names and per-structure field-spec lists) as passed by Py4J from Python.

  134. def setStructures(structures: Array[(String, Array[String])]): PretrainedZeroShotMultiTask.this.type
  135. val structureThreshold: FloatParam

  136. val structures: Param[Array[(String, Array[String])]]

    Structure specifications in DSL format.

    Structure specifications in DSL format. Each entry defines one structured record type.

    Format: Array[(structureName, Array[fieldSpec])]

    • structureName — name of the structure (becomes the result of output annotations)
    • fieldSpec — one of:
      • "field_name" — list field, no constraint
      • "field_name::str" — single-value span field
      • "field_name::list" — multi-value span field (default)
      • "field_name::description" — list field with description hint
      • "field_name::str::description" — single-value with description
      • "field_name::[choice1|choice2|choice3]" — classification field restricted to listed values (forces dtype=str; separate choices with |)
      • "field_name::[choice1|choice2]::description" — classification field with description

    Each extracted structure instance is emitted as one Annotation with annotatorType = "struct". The metadata map contains one key per field whose value is a JSON-encoded string:

    • str span field → {"text":"...","confidence":0.9,"start":0,"end":5}
    • list span field → [{"text":"...","confidence":0.9,"start":0,"end":5},...]
    • str classification field → {"text":"choice","confidence":0.9}
    • list classification field → [{"text":"choice","confidence":0.9},...]
    • Fields with no match are omitted from the map.

    Examples:

    ("product_info", Array(
      "name::str",
      "price::str::Price including currency symbol",
      "features::list",
      "availability::[in_stock|pre_order|sold_out]"
    ))
    ("person", Array("name::str::Full name", "title::str", "organization::str"))
  137. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  138. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  139. final def transform(dataset: Dataset[_]): DataFrame
    Definition Classes
    AnnotatorModel → Transformer
  140. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  141. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  142. final def transformSchema(schema: StructType): StructType
    Definition Classes
    RawAnnotator → PipelineStage
  143. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  144. val uid: String
    Definition Classes
    PretrainedZeroShotMultiTask → Identifiable
  145. def validate(schema: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  146. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  147. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  148. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  149. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  150. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  151. def writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: InternalOnnxWrapper, suffix: String, fileName: String, encrypt: Boolean): Unit
    Definition Classes
    InternalWriteOnnxModel
  152. def writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: InternalOnnxWrapper, suffix: String, fileName: String): Unit
    Definition Classes
    InternalWriteOnnxModel
  153. def writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(InternalOnnxWrapper, String)], suffix: String, encrypt: Boolean = false): Unit
    Definition Classes
    InternalWriteOnnxModel
  154. def writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(InternalOnnxWrapper, String)], suffix: String): Unit
    Definition Classes
    InternalWriteOnnxModel
  155. def writeSentencePieceModel(path: String, spark: SparkSession, spp: SentencePieceWrapper, suffix: String, filename: String): Unit
    Definition Classes
    WriteSentencePieceModel

Inherited from CheckLicense

Inherited from HasEngine

Inherited from WriteSentencePieceModel

Inherited from InternalWriteOnnxModel

Inherited from HasBatchedAnnotate[PretrainedZeroShotMultiTask]

Inherited from AnnotatorModel[PretrainedZeroShotMultiTask]

Inherited from CanBeLazy

Inherited from RawAnnotator[PretrainedZeroShotMultiTask]

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from HasOutputAnnotatorType

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from Model[PretrainedZeroShotMultiTask]

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

anno

param

setParam

Ungrouped